一、安裝apache
2. make
3. make install;6. 設(shè)置根目錄/usr/local/apache2,靜態(tài)頁面目錄/data/simba/apache/htdocs/web 和
cgi-bin 目錄/data/simba/apache/cgi-bin/7. 設(shè)置開機(jī)啟動(dòng)echo '/usr/local/apache2/bin/apachectl start' >> /etc/rc.d/rc.local
cp -r /usr/local/apache2/bin/apachectl /etc/init.d/apache-httpd// service apache-httpd restart
二、安裝php
1. 安裝libxml2; 直接./configure make && make install
2. 安裝php
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs
--with-config-file-path=/usr/local/lib --enable-soap
3. make && make install
4. cp /home/php-5.5.5/php.ini-production /usr/local/lib/php.ini
5. 裝php soap 模塊
cd /home/php-5.5.5/ext/soap #運(yùn)行phpize 生成configure
/usr/local/php5/bin/phpize
./configure --with-php-config=/usr/local/php5/bin/php-config --enable-soap
make && make install
編譯后的soap.so 文件保存在
/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/
查找/usr/local/lib/php.ini 中的extension_dir = "./"
修改為extension_dir =
"/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/"
增加以下行:extension = "soap.so"
6. 生成mod_rewrite.so cd /home/httpd-2.0.64/modules/mappers/
/usr/local/apache2/bin/apxs -c mod_rewrite.c
/usr/local/apache2/bin/apxs -i -a -n mod_rewrite mod_rewrite.la
7. 修改http.conf 配置文件,加入php 解析和mod_rewrite.so 模塊
AddType application/x-httpd-php .php .phtml .php3 .inc
AddType application/x-httpd-php-source .phps
LoadModule php5_module modules/libphp5.so
LoadModule rewrite_module modules/mod_rewrite.so
8. php 裝mysql 模塊(需要先安裝mysql,路徑/usr/local/mysql/) // 與裝soap 模塊類似
cd /home/php-5.5.5/ext/mysql #運(yùn)行phpize 生成configure
/usr/local/php5/bin/phpize
./configure --with-php-config=/usr/local/php5/bin/php-config --with-mysql=/usr/local/mysql/
make && make install
編譯后的mysql.so 文件保存在
/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/
查找/usr/local/lib/php.ini 中的extension_dir = "./"
修改為extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/"
增加以下行:extension = "mysql.so"
三、Mysql 安裝
1) 安裝Mysql
// 編譯安裝
./configure --prefix=/usr/local/mysql
make && make install
// 設(shè)置配置文件的監(jiān)聽ip 和data 目錄
groupadd mysql
useradd -g mysql mysql
mkdir /data/mysql_db
chown -R mysql:mysql /data/mysql_db
cp support-files/my-medium.cnf /etc/my.cnf
更改my.cnf bind-address=本機(jī)ip datadir=/data/mysql_db
// 配置權(quán)限表
chown -R mysql:mysql /usr/local/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/data/mysql_db
// 設(shè)置開啟自啟動(dòng)
cp -r support-files/mysql.server /etc/init.d/mysqld ; chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
/etc/init.d/mysqld start // service mysqld restart
export PATH=/usr/local/mysql/bin:$PATH
// 配置客戶端訪問,可不設(shè)置root 密碼
/usr/local/mysql/bin/mysqladmin -u root password root@test
mysql -A -uroot -proot@test
// 新增用戶,給予權(quán)限
create user simba identified by 'simba@test';
grant select,insert,update,delete, create, drop on *.* to simba@'%' identified by 'simba@test' ;
聯(lián)系客服