How to Install LCMP (Cherokee, MySQL and PHP) on CentOS 6 /_MySQL

WBOY
풀어 주다: 2016-06-01 13:13:32
원래의
1489명이 탐색했습니다.

CentOS

cherokee vpsCherokee is a lightweight, flexible and completely customizable  Web server. Its speed and ease of use makes Cherokee one of the top running alternatives to Apache.

Cherokee can be easily be installed using RPM packages or it can be compiled from source. If there is another Web server already installed on yourvirtual server, it needs to be stopped first.


Apache is usually installed by default, so to check if Apache is running, execute the following command:

ps aux | grep httpd
로그인 후 복사

If it is up and running, you need to stop the Apache service:

/etc/init.d/httpd stop
로그인 후 복사

To disable Apache, execute the following command:

chkconfig httpd off
로그인 후 복사

Or, to completely remove Apache from your virtual server,  run the following command:

yum remove httpd
로그인 후 복사

Download and install Cherokee and its dependencies:

cd /opt/wget http://dl.fedoraproject.org/pub/epel/6/i386/cherokee-1.2.101-3.el6.i686.rpmwget http://dl.fedoraproject.org/pub/epel/6/i386/GeoIP-1.4.8-1.el6.i686.rpmwget http://dl.fedoraproject.org/pub/epel/6/i386/spawn-fcgi-1.6.3-1.el6.i686.rpmrpm -Uvh cherokee-1.2.101-3.el6.i686.rpm GeoIP-1.4.8-1.el6.i686.rpm spawn-fcgi-1.6.3-1.el6.i686.rpmchkconfig cherokee --addchkconfig cherokee onchkconfig --list | grep cherokee
로그인 후 복사

The output should be as follows:

cherokee0:off 1:off 2:on3:on4:on5:on6:off
로그인 후 복사

Install mysql:

yum install mysql mysql-serverchkconfig --levels 235 mysqld on/etc/init.d/mysqld star
로그인 후 복사

Create a password for the MySQL ‘root’ user:

mysqladmin -u root password xxxxxxxx
로그인 후 복사

where ‘xxxxxxxx’ will be your new MySQL root password.

Install rrdtool and php using the following command:

yum install rrdtool php php-bcmath php-cli php-common php-devel php-gd php-imap php-mbstring php-mcrypt php-mysql php-pdo php-pecl-apc php-pecl-memcache php-pear php-soap php-xml php-xmlrpc
로그인 후 복사

Edit the ‘/etc/php.ini’ file and uncomment this line:

cgi.fix_pathinfo = 1
로그인 후 복사

Execute the following commands:

vi /usr/bin/php-fastcgi
로그인 후 복사
#!/bin/sh /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 6 -u cherokee -f /usr/bin/php-cgi
로그인 후 복사
chmod 755 /usr/bin/php-fastcgi
로그인 후 복사

Create an init script like this:

vi /etc/init.d/php-fastcgi
로그인 후 복사
start() { [ -x $phpfastcgi ] || exit 5 echo -n $"Starting $prog: " daemon $phpfastcgi retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval }stop() { echo -n $"Stopping $prog: " killproc $prog retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval }restart() { stop start }rh_status() { status $prog }rh_status_q() { rh_status >/dev/null 2>&1 }case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart) $1 ;; status) rh_status ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 2 esac
로그인 후 복사
chmod 755 /etc/init.d/php-fastcgichkconfig --add php-fastcgichkconfig php-fastcgi onservice php-fastcgi start
로그인 후 복사

Create a self signed certificate:

mkdir /etc/cherokee/ssl/openssl req -days 720 -new -x509 -nodes -out /etc/cherokee/ssl/cherokee.pem -keyout /etc/cherokee/ssl/cherokee.pem
로그인 후 복사

Edit the Cherokee configuration file (/etc/cherokee/cherokee.conf):

Look for the following line:

server!bind!1!port = 80
로그인 후 복사

And add the following lines:

server!bind!2!port = 443server!bind!2!tls = 1
로그인 후 복사

Add the following lines before # Icons:

vserver!1!rule!105!document_root = /var/www/cherokeevserver!1!rule!105!handler = fcgivserver!1!rule!105!handler!balancer = round_robinvserver!1!rule!105!handler!balancer!source!10 = 1vserver!1!rule!105!match = extensionsvserver!1!rule!105!match!check_local_file = 0vserver!1!rule!105!match!extensions = php,php5vserver!1!rule!5!encoder!gzip = allowvserver!1!rule!5!handler = server_infovserver!1!rule!5!handler!type = just_aboutvserver!1!rule!5!match = directoryvserver!1!rule!5!match!directory = /aboutsource!1!env_inherited = 1source!1!host = 127.0.0.1:9000source!1!interpreter = /usr/bin/php-fastcgisource!1!nick = PHP-FastCGIsource!1!type = interpreter
로그인 후 복사

Restart the Cherokee service for the changes to take effect:

/etc/init.d/cherokee restart
로그인 후 복사

Cherokee can be configured via web interface, which can be started using the following command:

cherokee-admin -b xxx.xxx.xxx.xxx
로그인 후 복사

where ‘xxx.xxx.xxx.xxx’ is your virtual server IP address.

The output of this command will show the login credentials and the URL of the web interface:

Login: User:admin One-time Password: 6rvl9m0HD4Zr7bP5Web Interface: URL: http://Your_VPS-IP-address:9090
로그인 후 복사

Cherokee’s admin will now be listening on port 9090 of yourvirtual server, so you can open http://Your_VPS-IP-address:9090 using a web browser:

cherokee

To add a new virtual host in Cherokee, follow the instructions below:

Log in at http://Your_VPS-IP-address:9090 and click the ‘vServers’ icon from the top-menu. Then, click the ‘+’ button next to ‘Virtual Servers’:

cherokee - add virtual host

Select ‘Languages’, then select ‘PHP’, click ‘Add’, ‘Next’, then set ‘/var/www/path_to_your_domain.com_website_files’ as Document Root, add ‘www.your_domain.com’ to the ‘New Host Name’ field and click ‘Create’.

Using the Cherokee web interface you can easily install WordPress, Joomla, Drupal, Zen Cart, OpenX, Sugar CE, Moodle, phpBB, MediaWiki, Redmine, Trac and other polupar applications.

Of course you don’t have to do any of this if you use one of ourLinux VPS Hostingservices, in which case you can simply ask our expert Linux admins to install Cherokee for you. They are available 24×7 and will take care of your request immediately.

PS.If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!