Linux building dynamic web server installation

Time:2022-1-11

Basic configuration
Install web server: httpd-2 X.X
Let’s optimize it first
Set variables according to CPU
#export CFLAGS=”-O2 -march=pentium4 -pipe” && CXXFLAGS=$CFLAGS
The “- March” option means that binary code is compiled for a specific CPU type (it cannot run on a lower level CPU),
Intel is usually pentium2, pentium3, pentium3m, Pentium4, pentium4m, pentium-m, Prescott, nocona
Note: pentium3m / pentium4m are mobile P3 / P4 for notebook; Pentium-m is the CPU of Centrino I / II generation notebook;
Prescott is P4 with sse3 (famous for being hot enough to fry eggs); Nocona is the latest P4 with emt64 (64 bit) (it can also fry eggs)
AMD is usually: K6, K6-2, k6-3, Athlon, Athlon tbird, Athlon XP, Athlon MP, Opteron, Athlon64, Athlon FX
AMD is generally DIYer, so there is no need to explain.

1. Decompression
#./configure –sysconfdir=/etc/ –enable-ssl –enable-modules
#make;make install
2. Start service
#/usr/local/apache2/bin/apachectl start
3. Test
#links http://localhost
#lynx http://localhost
The default website directory is / usr / local / apache2 / HtDocs / index html
netstat -tul |grep 80
Install MySQL
1. Decompression
# ./configure –sysconfdir=/etc –with-extra-charsets=latin1,utf8,gbk,big5,gb2312
– with extra charsets specifies other codes we need to use. Sometimes GBK is used for mobile networks.

#.make ;make install
#cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
2. 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. Log in and 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 old PHP3 php2

#make ; make install
#cp php.ini-dist /usr/local/lib/php.ini
2. Edit the Apache configuration file / etc / httpd Conf, add
AddType application/x-httpd-php .php .phtml
3. Write the test web page / usr / local / apache2 / HtDocs / test php
4. Visit the test web page
# links http://localhost/test.php
Close out work
1. Let Apache start automatically
Add to boot script / etc / RC local
/usr/local/apache2/bin/apachectl start
2. Start the MySQL database server automatically
#cp /usr/local/share/mysql/mysql.server /etc/init.d/mysqld
#chkconfig mysqld on

Recommended Today

Little bear paddle exercise book-01 handwritten numeral recognition

Little bear paddle exercise book-01 handwritten numeral recognition brief introduction The development and testing of this project are carried out under Ubuntu 20.04 system.View the latest code of the project home page:Little bear paddle exercise bookHome page of Baidu PaddlePaddle AI Studio:Little bear paddle exercise book-01 handwritten numeral recognitionCUDA reference for Ubuntu system installation:Installation of […]