Webmin簡(jiǎn)介
Webmin是功能非常強(qiáng)大的Unix系統(tǒng)管理面板。管理員通過(guò)任何一款瀏覽器,就能添加用戶帳號(hào),管理Apache,DNS,文件共享系統(tǒng),甚至更多。Webmin允許你DIY模塊,你只需要到模塊管理頁(yè)面,增加你需要的功能,刪除你認(rèn)為不實(shí)用的功能。如果你熟悉perl,你甚至可以自己開(kāi)發(fā)模塊來(lái)增加Webmin功能。使用Webmin管理linux服務(wù)器,你將可以可視化管理你的服務(wù)器,完成脫離了命令行模式的管理方法。下面我們來(lái)介紹如何使用Webmin(下面的所有操作都是在centos中進(jìn)行)。
yum安裝nginx,php,mysql,fastcgi
LNMP(即nginx-mysql-php)服務(wù)器一直是被認(rèn)為性能高,內(nèi)存占用少的服務(wù)器,下面我們來(lái)介紹怎么通過(guò)簡(jiǎn)單的YUM命令安裝。
安裝mysql
1、先卸載系統(tǒng)自帶的apache,然后更新軟件庫(kù)
yum remove httpd
yum update |
2、yum安裝mysql
yum install mysql mysql-server |
3、加入啟動(dòng)項(xiàng)并啟動(dòng)mysql
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start |
4、設(shè)置mysql密碼及相關(guān)設(shè)置
mysql_secure_installation |
因?yàn)榈谝淮螁?dòng)這命令,所以直接回車下一步,然后輸入你的mysql密碼,按照提示操作。
安裝nginx
1、導(dǎo)入軟件庫(kù)
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm |
2、yum安裝nginx
3、添加到啟動(dòng)項(xiàng)并啟動(dòng)nginx
chkconfig --levels 235 nginx on
/etc/init.d/nginx start |
安裝php
1、安裝php及相關(guān)模塊
yum install lighttpd-fastcgi php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy |
2、編輯文件php.ini,在文件末尾添加cgi.fix_pathinfo = 1
3、執(zhí)行以下命令以啟動(dòng)php fastcgi守護(hù)進(jìn)程,并以用戶組nginx和用戶nginx身份運(yùn)行。
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u nginx -g nginx -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid |
4、設(shè)置開(kāi)機(jī)啟動(dòng)fastcgi.
編輯文件 vi /etc/rc.local,增加如下代碼:
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u nginx -g nginx -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid |
修改nginx配置文件,添加fastcgi支持
1、修改nginx.conf文件
配置文件部分代碼:
[...]
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
[...]
|
2、重啟nginx
/etc/init.d/nginx restart |
3、建立info.php文件
vi /usr/share/nginx/html/info.php |
添加如下代碼:
在瀏覽器打開(kāi)測(cè)試是否正常,如http://www.zhumaohai.com/info.php。 本文出自:億恩科技【mszdt.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|