本文共 2702 字,大约阅读时间需要 9 分钟。
安装必要的软件包:
[root@mail~]# yum -y install openssl-devel[root@mail~]# yum -y install ncurses-devel libtermcap-devel[root@mail~]# yum -y install libxml2-devel[root@mail~]# yum -y remove httpd mysql-server mysql php-mysql
[root@mail~]# tar zxf /软件包路径/httpd-2.2.26.tar.gz -C /usr/src/[root@mailhttpd-2.2.26]# ./configure --prefix=/usr/local/httpd \--enable-so --enable-rewrite --enable-cgi \--enable-charset-lite --enable-ssl \--enable-suexec --with-suexec-caller=daemon \--with-suexec-docroot=/usr/local/httpd/htdocs
[root@mailhttpd-2.2.26]# make[root@mailhttpd-2.2.26]# make install
[root@mail~]# cp -f /usr/local/httpd/bin/apachectl /etc/init.d/httpd[root@mail~]# vim /etc/init.d/httpd
#!/bin/bash#chkconfig: 35 85 15#description: Apache is a World Wide Web Server..[root@mail~]# chmod +x /etc/init.d/httpd[root@mail~]# chkconfig --add httpd
[root@mail~]# useradd -M -u 49 -s /sbin/nologin mysql
[root@mail~]# tar zxf /软件包路径/mysql-5.1.62.tar.gz -C /usr/src/[root@mailmysql-5.1.62]# ./configure --prefix=/usr/local/mysql \--with-charset=utf8 --with-collation=utf8_general_ci \--with-extra-charsets=gbk,gb2312
[root@mailmysql-5.1.62]# make[root@mailmysql-5.1.62]# make install[root@mailmysql]# bin/mysql_install_db --user=mysql
[root@mail~]# chown -R root:mysql /usr/local/mysql/[root@mail~]# chown -R mysql /usr/local/mysql/var/
[root@mail~]# cp -f /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf[root@mail~]# vim /etc/my.cnf
# skip-lockingskip-external-locking...
[root@mail~]# ln -sf /usr/local/mysql/bin/* /usr/local/bin/[root@mail~]# vim /etc/ld.so.conf.d/mysql-64.conf[root@mail~]# ldconfig
[root@mail~]# cp -f /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld[root@mail~]# chmod +x /etc/init.d/mysqld[root@mail~]# chkconfig --add mysqld
[root@mail~]# tar zxf /软件包路径/php-5.4.24.tar.gz -C /usr/src/[root@mailphp-5.4.24]# ./configure --prefix=/usr/local/php \--enable-mbstring --enable-sockets \--with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql \--with-config-file-path=/usr/local/php
[root@mailphp-5.4.24]# make[root@mailphp-5.4.24]# make install
[root@mail~]# vim /usr/local/httpd/conf/httpd.conf...LoadModule php5_module modules/libphp5.soDirectoryIndex index.html index.php AddType application/x-httpd-php .php...
[root@mail~]# service mysqld restart[root@mail~]# service httpd restart
[root@svr5~]# vim /usr/local/httpd/htdocs/test2.php
http://服务器地址/test2.php
应该显示"Success!!"
转载地址:http://bkgyk.baihongyu.com/