1.修改預設的 firewall 程式為自訂的
sudo vim /etc/rc.local
#/usr/bin/firewall.sh 改成 /usr/bin/firewall.sh
2.修改 firewall.sh
sudo vim /usr/bin/firewall.sh
3.安裝php-ldap套件
sudo yum -y install php-ldap
4.重啟apache2
sudo /sbin/service httpd restarts
5.修改mysql密碼
mysqladmin -uroot -p password '新密碼'
6.apache設定檔
/etc/httpd/conf.d/acfs..conf
7.安裝ncftp
sudo yum -y install ncftp
8.php.ini
max_input_vars =3000
9.改ip
cd /etc/sysconfig/network-scripts/
底下ifcfg-xxx
程式CODE
2018年4月11日 星期三
2013年9月30日 星期一
CentOs啟動SSH連線
Centos預設已安裝SSH
只要啟動就好了
/etc/init.d/sshd restart
再來,允許連線在
vim /etc/hosts.allow
sshd:ip,ip,
不允許連線在
vim /etc/hosts.deny
sshd:ALL
Centos5.5下安裝LAMP
一、安裝
# yum install httpd mysql-server php php-devel php-mysql
# yum install php-gd
php5.1升級php5.2
參考官方網站
http://wiki.centos.org/HowTos/PHP_5.1_To_5.2
上面方法會全面update,花很長時
若僅升級php
# yum update php -y
不過升級完畢之後,
據http://kennyp.pixnet.net/blog/post/26139464
mcrypt 跟imagick必須要重新安裝,要不然會有問題
確認是否升級成功:
# php -v
二、設定MySQL
default-character-set = utf8
設定 MySQL 服務隨系統一起啟動
# chkconfig mysqld on
確認 MySQL 自動啟動有打開
# chkconfig --list mysqld
如果2--5為on的狀態就OK
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
啟動 MySQL 服務
# /etc/rc.d/init.d/mysqld start
啟動 MySQL 以後,設定 root 的密碼
# mysqladmin -u root password 'Your Password'
三、設定Apache
設置 Apache 隨系統自動啟動
# chkconfig httpd on
確認2--5為on的狀態就OK
# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
啟動 Apache 服務
# /etc/init.d/httpd start
關閉 Apache 服務
# /etc/init.d/httpd stop
重啟 Apache 服務
# /etc/init.d/httpd restart
四、設定Apache的設定檔
vim /etc/httpd/conf/httpd.conf
1.不要列出檔案目錄
Options Indexes FollowSymLinks MultiViews
改成這樣存檔後,重新啟動Apache即可:
Options FollowSymLinks MultiViews
2.首頁檔案的設定
DirectoryIndex index.html index.htm index.html.var
3.#設定保持持續連線
KeepAlive Off #改為 On
MaxKeepAliveRequests 100 #改為500
4.更改網頁根目錄
改
DocumentRoot "/var/www/html"
及
<Directory "/var/www/html">
記得新的目錄權限要改755
五、若不能連上線
也許是selinux沒關掉
修改
/etc/selinux/config
把SELINUX="enforcing" 改為disabled
也有可能是防火牆在搞鬼,沒設好,可以先關掉
查看防火牆狀況:
/etc/init.d/iptables status
開啟:
/etc/init.d/iptables start
關閉:
/etc/init.d/iptables stop
訂閱:
文章 (Atom)