sysconfdir是指定apache配置文件位置,不指定默认在conf目录下, 建议指定。 –with-included-arp指定arp –enable-so,启用函数文件 –enable-deflate=shared,开启共享库 –enable-ssl,开启ssl模块 –enable-rewrite=shared,开启apache地址重写充能 make make install
报错提示: httpd: Could not open configuration file /usr/apache/etc/httpd.conf: No such file or director 说明配置文件地址不对,可以启动脚本指定配置文件位置 ./bin/apachectl -f /usr/local/apache/etc/httpd.conf -k start
报错提示: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message 这是没有指定端口和地址 打开配置文件httpd.conf 搜索ServerName(大约200行左右) 改为ServerName localhost:80,如果有注释就去掉注释
d.设定MySQL密码 /usr/local/mysql/bin/mysqladmin -u root -password lrq3547 如果报错则直接登录MySQL改密码,这时候是没有密码的状态 #/usr/local/mysql/bin/mysql -u root -p mysql> use mysql; mysql> GRANT ALL PRIVILEGES ON . TO root@“%” IDENTIFIED BY “123456”; mysql> update user set Password = password(‘123456’) where User=‘root’; mysql> flush privileges; mysql> exit;
e.测试登录MySQL /usr/local/mysql/bin/mysql -u root -p
14.安装PHP
cd /php-x.x.x ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc/ --with-apx52=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng/ --with-freetype-dir=/usr/local/freetype/ --with-mcrypt=/usr/local/libmcrypt --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring=all --enable-soap --enable-sockerts --with-pdo-mysql=/usr/local/mysql --with-gd --without-pear make make install
错误提示:遇到缺失 No package ‘sqlite3’ found yum -y install sqlite-devel
错误提示:出现No package ‘oniguruma‘ found 在’–enable-mbstring’参数后添加’–disable-mbregex’参数,意为不使用mbstring的正则功能,不再需要oniguruma库。 或者使用源码安装oniguruma库 ./configure --prefix=/usr --libdir=/lib64
c.测试php网页是否能够正常解析(apache和php连通性) vim /usr/local/apache/htdocs/test.php
<?phpphpinfo();?>
通过浏览器访问:http://apache服务器地址/test.php
15.为PHP安装openssl模块
模块需通过PHP本身使用,所以后安装。
openssl是一个强大的安全套接字层密码库,囊括主要的密码算法,常用的密钥和证书封装管理功能及ssl协议,并提供丰富的应用程序供测试或其他目的使用。 cd /php-x.x.x/ext/openssl mv config0.m4 config.m4 /usr/local/php/bin/phpize ./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config make make install
我这里是zip包,所以用unzip解包 unzip pecl-memcache-phpx.zip cd pecl-memcache-phpx.x /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make install
安装了memcache模块,但是本身软件是没有安装的,而openssl是默认安装的。 yum -y install libevent-devel 先安装依赖 cd /memcachedx.x.x ./configure --prefix=/usr/local/memcached make make install
phpMyAdmin是一个以PHP为基础,以web-Base方式架构在网站主机上的MySQL数据库管理工具,让管理者可用web接口管理MySQL数据库 cp -a /phpMyAdmin -x.x /usr/local/apache/htdocs/phpmyadmin cd /usr/local/apache/htdocs/phpmyadmin ap -a config.sample.inc.php config.inc.php vim config.inc.php