LinuxWeb1, rpm package web1.1 installation 1.2 configuration 1.2.1 virtual host 1.3 integration php, mysql1.4 integration ftp service 2, source code compilation web2.1 installation 2.2 configuration 2.2.1 virtual host 2.3 integration php, mysql2.4 integrated ftp server...
Linux Web
1. rpm package web
1.1 Installation
1.2 Configuration
1.2.1 VM
1.3 integrate php and mysql
1.4 integrate ftp services
2. source code compiled web
2.1 Installation
2.2 Configuration
2.2.1 VM
2.3 integrate php and mysql
2.4 integrate ftp services
----------------
1. install the system (rpm Package)
Partitioning scheme (the hard disk is 80 GB)
/Boot 200 M
/10G
Swap 2G
/Home all remaining
*/Home is the space used by the user, which will be available for all the virtual hosts in the future.
Select the World Wide Web server-now custom
Add three binds to the ftp service, nfs service, email service, and network infrastructure server.
Install
* If the DNS server is deployed separately. No need to install
After the installation is complete
1. configure the ip address
Configuration in setup
2. disable the firewall
Close setup
3. disable SELinux.
Vi/etc/selinux/config
Change
SELINUX = disabled
4. restart
------------------------------------
Go to the system, start the httpd service, and test
The test page shows that apache is installed.
------------------------------------
Apache configuration file
/Etc/httpd/conf/httpd. conf # Main configuration file
/Etc/httpd/conf. d # directory for storing extended configuration files
Manual. conf # Help manual configuration (close recommended)
Php. conf # php configuration
Ssl. conf # ssl encrypted access configuration
Welcome. conf # welcome page configuration
Perl. conf # perl configuration
Webalizer. conf # log analysis configuration
Wsgi. conf # wsgi support
/Etc/httpd/conf/httpd. conf # Description of the configuration file
ServerTokens OS
ServerRoot "/etc/httpd" # Main httpd file storage directory
PidFile run/httpd. pid # location of the running file
Timeout 60 # The client connection Timeout is 60 seconds.
# Keep alive access
KeepAlive On # open it again
MaxKeepAliveRequests 100 # the maximum number of connections per ip address is 100
KeepAliveTimeout 15 # each maximum time is 15 seconds
Connections control
# Process control
StartServers 8 # open several service processes
MinSpareServers 5 # Minimum 5
MaxSpareServers 20 # up to 20
ServerLimit 256 # up to 256
MaxClients 256 # maximum number of connected clients
MaxRequestsPerChild 4000 # the maximum number of requests is 4000
# Thread mode
StartServers 4 #4 servers
MaxClients 300 # a maximum of 300 entries per thread
MinSpareThreads 25 # The minimum number of threads is 25
MaxSpareThreads 75 # The most multithreading is 75
ThreadsPerChild 25 # The default value is 25.
MaxRequestsPerChild 0 # the maximum number of requests is unlimited.
Listen 80 # The default server listening port is 80.
# Expansion module. Self-check
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
...
Include conf. d/*. conf # extended configuration file
User apache # apache User identity
Group apache # apache Group identity
ServerAdmin root @ localhost # server administrator email address
UseCanonicalName Off # useless
DocumentRoot "/var/www/html" # default website page storage directory
# Website/directory permissions
Options FollowSymLinks # connection supported
AllowOverride None
# Default website page storage directory permission
Options Indexes FollowSymLinks # site index, supporting connections
AllowOverride None # access control
Order allow, deny # allow and reject
Allow from all # Allow all
# Deny from ip # Deny access from an ip address
# Personal homepage support
UserDir disabled
DirectoryIndex index.html. var # directory index page name
# Access control file. htaccess
AccessFileName. htaccess
Order allow, deny
Deny from all
Satisfy All
AddDefaultCharset UTF-8 # default page encoding for UTF-8
----------------------------------------------
Add ServerName web1.amao.com
1. the personal homepage supports "http: // ip /~ User name to visit the personal homepage
A. modify the configuration file to support such access
Vi/etc/httpd/conf/httpd. conf
Find
#
# UserDir is disabled by default since it can confirm the presence
# Of a username on the system (depending on home directory
# Permissions ).
#
UserDir disabled # Remove access from a user
#
# To enable requests /~ User/to serve the user's public_html
# Directory, remove the "UserDir disabled" line above, and uncomment
# The following line instead:
#
# UserDir public_html # User's catalog page Directory
Change
#
# UserDir is disabled by default since it can confirm the presence
# Of a username on the system (depending on home directory
# Permissions ).
#
UserDir disabled root
#
# To enable requests /~ User/to serve the user's public_html
# Directory, remove the "UserDir disabled" line above, and uncomment
# The following line instead:
#
UserDir public_html
Remove the # sign before the following content and add the "-" sign before Indexes.
AllowOverride FileInfo AuthConfig Limit
Options MultiViews-Indexes SymLinksIfOwnerMatch IncludesNoExec
Order allow, deny
Allow from all
Order deny, allow
Deny from all
B. add a user and create a directory for the personal homepage.
Adduser test # Add a user
Cd/home/test
Mkdir public_html # Create a directory for the personal homepage in the user directory
Chown test. test public_html # configure the directory permission for the personal homepage
Chmod o + x/home/test # add the permission to list other users in the user's home directory (cannot be opened without the permission)
Cd/home/test/public_html
Echo "test"> index.html
C. restart the service and test
Service httpd restart
Enter http: // ip address/~ in the browser /~ Test
--------------------------------------------------------------------
Name-based virtual host (important)
1. make DNS
Vi/etc/named. conf
Change 3 any
Vi/etc/named. rfc1912.zones
Add
Zone "amao.com "{
Type master;
File "amao.com. hosts ";
};
-----------------
Cd/var/named/
Cp named. localhost amao.com. hosts
Vi amao.com. hosts
Add
Www in a the ip address of your web server
---------
Chown root. named amao.com. hosts
Service named restart
---------------------------------------------
Add a domain name for agou.com.
2. add a virtual host to the apache configuration file (this is done on the personal homepage first)
Vi/etc/httpd/conf/httpd. conf
Add at the end of the file
NameVirtualHost 192.168.100.1 # Name the ip address on which the VM is located
NameVirtualHost 192.168.100.1
ServerName www.amao.com
DocumentRoot/home/amao/public_html
ServerName www.agou.com
DocumentRoot/home/agou/public_html
3. set up amao users and agou users in the same way as on the personal homepage.
4. restart the service and enter it in the browser.
Http://www.amao.com
Http://www.agou.com
Test
This article is from the blog "Wang Dao-Xu Zhongzhi (MakeWong )".