万网centos5.4安装

一、安装SSH

安装SSH
yum install openssh

启动SSH
service sshd start

设置开机运行
chkconfig sshd on

修改:

vi /etc/ssh/ssh_config

Port 18439

PermitRootLogin no

PasswordAuthentication no

PermitEmptyPasswords no

ServerKeyBits 1024

二、替换CentOS镜像服务器,修改CenOS-Base.repo

中国官方镜像网站:http://centos.ustc.edu.cn

修改CentOS:

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save
wget http://centos.ustc.edu.cn/CentOS-Base.repo.5
mv CentOS-Base.repo.5 CentOS-Base.repo

三、安装Apache+php+Mysql

1、安装Apahce、PHP、MySQL、PHP连接MySQL库组件;

yum -y install httpd php mysql mysql-server php-mysql

2、安装Apache扩展

yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

四、安装Zend Optimizer

cd /usr/local/src

wget http://downloads.zend.com/optimizer/3.3.0/ZendOptimizer-3.3.0-linux-glibc21-i386.tar.gz

tar xzvf ZendOptimizer-3.3.0-linux-glibc21-i386.tar.gz
./ZendOptimizer-3.3.0-linux-glibc21-i386/install.sh

安装目录/usr/local/Zend5

五、启动服务配置

/sbin/chkconfig httpd on (设置Apache为自启动)
/sbin/chkconfig -add mysqld (MySQL服务)
/sbin/chkconfig mysqld on (mysqld服务)
service httpd start (自启动httpd服务)
service mysqld start (自启动mysqld服务)


六、lua 

cd /usr/local/src

yum -y install gcc

yum -y install readline-devel

yum -y install ncurses-devel


wget http://www.lua.org/ftp/lua-5.1.4.tar.gz

tar -zxvf lua-5.1.4.tar.gz

cd lua-5.1.4

make linux

sudo make install


cd ..

wget http://luarocks.org/releases/luarocks-2.0.8-rc2.tar.gz

tar zxvf luarocks-2.0.8-rc2.tar.gz

cd luarocks-2.0.8

./configure

make 

sudo make install


subversion:

cd ..

wget http://archive.apache.org/dist/subversion/subversion-1.6.11.tar.gz

wget http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz

tar zxvf sqlite-amalgamation-3.6.13.tar.gz

tar zxvf subversion-1.6.11.tar.gz

cp sqlite-3.6.13/sqlite3.c subversion-1.6.11/

cp sqlite-3.6.13/sqlite3.h /usr/local/include/

cd subversion-1.6.11

yum -y install apr apr-devel apr-util apr-util-devel zlib zlib-devel neon neon-devel

./configuare

make

make install


七、vsftpd

1:禁止匿名用户

vi /etc/vsftpd/vsftpd.conf 

将 
anonymous_enable=YES 
改为 
anonymous_enable=NO

2:

运行system-config-securitylevel,关闭SELinux。
# system-config-securitylevel
在界面中SELinux区域,选择Disabled。在选择Customize按钮,开机Firewall对FTP的支持。

八、lua依赖库

luarocks install luasocket

luarocks install luasql-mysql

luarocks install luasql-sqlite3

luarocks install lpeg

luarocks install lzlib

luarocks install luafilesystem

yum -y install openssl-devel

yum -y install curl curl-devel

luarocks install luasec

luarocks install md5

luarocks install luacurl

yum -y install mysql-devel

luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql MYSQL_LIBDIR=/usr/lib64/mysql/

luarocks install lua-cjson

八、防火墙设置

开启指定端口
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
/etc/rc.d/init.d/iptables save
使更改的防火墙生效
/etc/init.d/iptables restart

iptables配置文件:

vi /etc/sysconfig/iptables


关闭icmp:

-A INPUT -p icmp -j DROP


九:apache+fastcgi

sudo yum install -y httpd-devel

wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
tar zxvf mod_fastcgi-2.4.6.tar.gz
cd mod_fastcgi-2.4.6
cp Makefile.AP2 Makefile
vi Makefile,

编辑top_dir = /usr/local/apache2 为top_dir=/var/www
make
make install

安装完成之后修改一下apache的配置文件http.conf,添加下面一些内容:

LoadModule fastcgi_module modules/mod_fastcgi.so

ScriptAlias /fcgi-bin/ "/data/wwwroot/fcgi-bin/"

#fastcgi

<Directory "/data/wwwroot/fcgi-bin">

    AllowOverride None

    Options +ExecCGI -Includes

    AddHandler fastcgi-script .fcg .fcgi

    Order allow,deny

    Allow from all

</Directory>

然后重新启动apache:

/var/www/bin/apachectl stop

/var/www/bin/apachectl start


安装fastcgi开发库


wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz

tar zxf fcgi-2.4.0.tar.gz

cd fcgi-2.4.0

./configure

make 

make install


测试:

1: 创建/data/wwwroot/fcgi-bin/目录

2: chmod 777 /data/wwwroot/fcgi-bin

3: 拷贝fcgi-2.4.0/example下的文件到/data/wwwroot/fcgi-bin/

4: 

cd /data/wwwroot/fcgi-bin/

cp echo echo.fcg

5:在浏览器输入:

http://www.cloud1911.com/fcgi-bin/echo.fcg


十: wsapi


luarocks install wsapi-fcgi

cp /usr/local/lib/lua/5.1/*.so /usr/local/lib





你可能感兴趣的:(apache,mysql,centos,service,防火墙,Zend)