Apache+PHP+MySQL安装相关
A. Install MySQL on Linux (From MySQL official site -- www.mysql.com)
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip cd mysql-VERSION
shell> CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
-fno-exceptions -fno-rtti" ./configure \
--prefix=/usr/local/mysql --enable-assembler \
--with-mysqld-ldflags=-all-static
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe --user=mysql &
B. Install apache
shell> tar xjvf httpd-VERSION.tar.bz2
shell> cd httpd-VERSION
shell> ./configure --prefix=/usr/local/apache --enable-so
PS: If you want to enable the most modules of apache,you can use "--enable-module=most". "--enable-modules=all" will enable all the modules of apache.
shell> make
shell> make install
C. Install php
shell> tar xzvf php-VERSION.tar.gz
shell> cd php-VERSION
shell> ./configure --prefix=/usr/local/php\
--with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
shell> make
shell> make install
shell> cp php.ini-dist /usr/local/php/lib/php.ini
D. Post configuration
Make sure the libphp5.so in /usr/local/apache/modules/ directory.then edit the httpd.conf in /usr/local/apache/conf/ directory with you fimilar text edit tools,such as vi. check if there is a line like this:
LoadModule php5_module modules/libphp5.so
then,add the following lines to httpd.conf:
AddType application/x-httpd-php .php .php3 .php4 .phtml
AddType application/x-httpd-php-source .phps
E. Start service and check if it works properly
Put a file named test.php into apache's document-root. add the following lines to test.php:
phpinfo();
?>
starting the web service via "/usr/local/apache/bin/apachectl start",and browsing it with your web client.(i.e Firefox):
http://127.0.0.1/test.php
this should works, but you still have a lot of works to do to make web server safer.
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip cd mysql-VERSION
shell> CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
-fno-exceptions -fno-rtti" ./configure \
--prefix=/usr/local/mysql --enable-assembler \
--with-mysqld-ldflags=-all-static
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe --user=mysql &
B. Install apache
shell> tar xjvf httpd-VERSION.tar.bz2
shell> cd httpd-VERSION
shell> ./configure --prefix=/usr/local/apache --enable-so
PS: If you want to enable the most modules of apache,you can use "--enable-module=most". "--enable-modules=all" will enable all the modules of apache.
shell> make
shell> make install
C. Install php
shell> tar xzvf php-VERSION.tar.gz
shell> cd php-VERSION
shell> ./configure --prefix=/usr/local/php\
--with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
shell> make
shell> make install
shell> cp php.ini-dist /usr/local/php/lib/php.ini
D. Post configuration
Make sure the libphp5.so in /usr/local/apache/modules/ directory.then edit the httpd.conf in /usr/local/apache/conf/ directory with you fimilar text edit tools,such as vi. check if there is a line like this:
LoadModule php5_module modules/libphp5.so
then,add the following lines to httpd.conf:
AddType application/x-httpd-php .php .php3 .php4 .phtml
AddType application/x-httpd-php-source .phps
E. Start service and check if it works properly
Put a file named test.php into apache's document-root. add the following lines to test.php:
phpinfo();
?>
starting the web service via "/usr/local/apache/bin/apachectl start",and browsing it with your web client.(i.e Firefox):
http://127.0.0.1/test.php
this should works, but you still have a lot of works to do to make web server safer.
相关推荐
tufeiax 2020-09-03
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11