theoforce 发表于 2018-11-22 09:51:03

apache+mysql5.0

  安装apache
# tar zxf httpd-2.2.17.tar.gz
# cd httpd-2.2.17
# ./configure --prefix=/application/apache2.2.17 --enable-deflate --enable-expires --enable-headers --enable-modules=most --enable-so --with-mpm=worker --enable-rewrite
# make && make install
# ln -s /application/apache2.2.17/ /application/apache
#groupadd apache
#useradd -s /sbin/nologin -g apache -M apache
# cd /application/apache/conf/
# cp httpd.conf httpd.conf.ori
# cp extra/httpd-vhosts.conf extra/httpd-vhosts.conf.ori
# vi httpd.conf
修改用户
User apache
Group apache
更改监听端口
#Listen 12.34.56.78:80
Listen 81
优化启动提示
#ServerName www.example.com:80
ServerName 127.0.0.1:80
开启扩展配置文件
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
给目录添加权限    #指定 网站根目录这是针对三个站点网站赋权限!这就不再需要修改站点目录,一次性 全做出来

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all


修改扩展配置文件

#vi extra/httpd-vhosts.conf
NameVirtualHost *:81


    ServerAdmin 123123@qq.com
    DocumentRoot "/data/www/www"
    ServerName123123123.com
    ErrorLog "logs/www-error_log"
    CustomLog "logs/www-access_log" common



    ServerAdmin 123123@qq.com
    DocumentRoot "/data/www/bbs"
    ServerName123123123.com
    ErrorLog "logs/bbs-error_log"
    CustomLog "logs/bbs-access_log" common


# mkdir /data/www/{www,bbs,blog} -p
# echo "http://blog.etiantian.org" >/data/www/blog/index.html
# echo "http://bbs.etiantian.org" >/data/www/bbs/index.html
检查语法
# /application/apache/bin/apachectl -t
Syntax OK
启动apache
# /application/apache/bin/apachectl start
查看端口
# netstat -lntp |grep 81
tcp      0      0 :::81                     :::*                        LISTEN      2733/httpd


安装mysql
# groupadd mysql
# useradd -g mysql mysql
# tar zxf mysql-5.0.40.tar.gz
# cd mysql-5.0.40
#./configure --prefix=/application/mysql-5.0.40 --sysconfdir=/etc --localstatedir=/var/lib/mysql --with--charset=gbk --enable-thread-safe-client --with-extra-charsets="gbk gb2312 big5 utf8"
# make && make install
初始化

# /application/mysql/bin/mysql_install_db
# chmod 777 /var/lib/mysql
# cd /ctyun/mysql-5.0.40/support-files/
#cp mysql.server /etc/init.d/mysqld
# chmod +x /etc/init.d/mysqld
# /etc/init.d/mysqld start
Starting MySQL                                             

# mysql
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.40 Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit
Bye




安装PHP


报错
(一)configure: error: libpng.(a|so) not found.

# cp -frp /usr/lib64/libpng* /usr/lib/

(二)

# yum install libjpeg libpng -y

开始安装
# tar zxf php-5.2.17.tar.gz
# cd php-5.2.17
# ./configure --prefix=/application/php-5.2.17 --with-apxs2=/application/apache/bin/apxs --with-mysql=/application/mysql --with-xmlrpc --with-openssl --with-zlib --with-freetype-dir --with-gd --with-png-dir --with-iconv=/usr/local/libiconv --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-static --enable-gd-native-ttf --with-curl --with-xsl --enable-ftp --with-libxml-dir --with-iconv

# make && make install
# ln -s /application/php-5.2.17/ /application/php
# /bin/cp php.ini-recommended /application/php/lib/php.ini



mysql> create database username;
mysql> grant all privileges on *.* to adfreelanc_6@localhost identified by 'password';





页: [1]
查看完整版本: apache+mysql5.0