How to build dynamic WEB Server with linux
This article mainly explains "how to build a dynamic WEB server with linux". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to build a dynamic WEB server with linux.
Basic configuration
Install web server: httpd-2.X.X
Optimize it first.
Set variables according to CPU
# export CFLAGS= "- O2-march=pentium4-pipe" & & CXXFLAGS=$CFLAGS
The "- march" option indicates that binaries are compiled for a specific cpu type (cannot be run on lower-level cpu)
Intel is usually: pentium2, pentium3, pentium3m, pentium4, pentium4m, pentium-m, prescott, nocona
Description: pentium3m/pentium4m is used for notebook mobile P3According to P4bot PentiumMurm is the cpu of Centrino I/II generation notebook.
Prescott is the P4 with SSE3 (famous for boiling hot enough to fry eggs); nocona is the latest P4 with EMT64 (64-bit) (you can also fry eggs)
AMD is usually: K6, K6-2, K6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, opteron, athlon64, athlon-fx
People who use AMD are usually DIYer, so there is no need to explain it.
1. Decompress
#. / configure-sysconfdir=/etc/-enable-ssl-enable-modules
# make;make install
two。 Start the service
# / usr/local/apache2/bin/apachectl start
3. test
# links http://localhost
# lynx http://localhost
Default website directory / usr/local/apache2/htdocs/index.html
Netstat-tul | grep 80
Install Mysql
1. Decompress
#. / configure-sysconfdir=/etc-with-extra-charsets=latin1,utf8,gbk,big5,gb2312
-with-extra-charsets specifies other codes that we want to use, sometimes using gbk, such as mobile networks.
# .make; make install
# cp / usr/local/share/mysql/my-large.cnf / etc/my.cnf
two。 Initialization
# useradd-d / usr/local/var mysql
# su-mysql
$/ usr/local/bin/mysql_install_db
3. Start the server
$/ usr/local/bin/mysqld_safe
4. Login test with / usr/local/bin/mysql
Install php
1. After decompression
#. / configure-with-apxs2=/usr/local/apache2/bin/apxs-with-mysql=/usr/local-enable-versioning
-enable-versioning supports the old php3.php2
# make; make install
# cp php.ini-dist / usr/local/lib/php.ini
two。 Edit the apache configuration file / etc/httpd.conf to add
AddType application/x-httpd-php .php .phtml
3. Write a test page / usr/local/apache2/htdocs/test.php
4. Visit the test web page
# links http://localhost/test.php
Wrap-up work
1. Let apache start automatically
Add to boot script / etc/rc.local
/ usr/local/apache2/bin/apachectl start
two。 Let the mysql database server start automatically
# cp / usr/local/share/mysql/mysql.server / etc/init.d/mysqld
# chkconfig mysqld on
At this point, I believe you have a deeper understanding of "linux how to build a dynamic WEB server". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!