Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Ubuntu Apache virtual host configuration     - HTTPS Encryption Algorithm (Linux)

- A drop datafile Oracle bug (Database)

- GNU Linux use diff to generate a patch with the patch (Linux)

- shell script: a key optimization CentOS system (Linux)

- Five useful commands to manage file types and system time in linux (Linux)

- Shell Script: Bulk add users, and set the random character password (Programming)

- CentOS 6.5 installation VNCServer implement graphical access (Server)

- CentOS 6.5 installation Python3.0 (Linux)

- Chkconfig set boot start under Linux (Linux)

- MySQL is configured to access external networks under Ubuntu (Database)

- Install GAMIT / GLOBK 10.50 software under Ubuntu 14.04 (Linux)

- Oracle DATABASE LINK (DBLINK) Create (Database)

- Realize screen recording and playback via Linux command (Linux)

- RedHat Linux 6.4 installation RTL8188CUS wireless network card driver (Linux)

- Production environment Linux bonding method standby mode slave card switch (Server)

- Oracle conditional select statements and looping statements (Database)

- BusyBox build root file system (Linux)

- Bash How to read a file line by line (Programming)

- rsync + inotify to achieve real-time synchronization (Server)

- Linux source code analysis tool (Linux)

  Ubuntu Apache virtual host configuration
  Add Date : 2018-11-21      
  Different from Windows, Apache, the configuration file is usually only one, is httpd.conf.

Native environment via apt-get install xxx

Linux, Apache configuration file is /etc/apache2/apache2.conf,Apache at startup automatically reads the configuration information in this file. Some other configuration files such as httpd.conf, etc., it is by Include instructions included.

There apache2.conf in sites-enabled directory in / etc / apache2 next there is a sites-available directory, in fact, there is the real profile, and sites- enabled directory is stored here are just some points to file symbolic links, you can use ls / etc / apache2 / sites-enabled / to confirm it.

So, if the apache is configured with multiple virtual hosts, each virtual host configuration files are placed in the sites-available, then the virtual host to disable, enable very convenient: When building sites-enabled at a point link to a virtual host configuration file, to enable it; if you want to shut down a virtual host, simply delete the link, there is no need to change the configuration file.

1. sudo cp /etc/apache2/sites-avaliable/000-default.conf, named test.conf

2. Modify the configuration file: test.conf

< VirtualHost *: 80 >

# The ServerName directive sets the request scheme, hostname and port that

# The server uses to identify itself. This is used when creating

# Redirection URLs. In the context of virtual hosts, the ServerName

# Specifies what hostname must appear in the request's Host: header to

# Match this virtual host. For the default virtual host (this file) this

# Value is not decisive as it is used as a last resort host regardless.

# However, you must set it for any further virtual host explicitly.

ServerName www.test.com

ServerAdmin webmaster @ localhost

DocumentRoot / var / www / html / test /

ErrorLog /var/www/html/test/error.log

CustomLog /var/www/html/test/access.log combined

< Directory "/ var / www / html / test" >

    Options FollowSymLinks

    DirectoryIndex index.php index.html index.htm

    AllowOverride All # Note that the configuration of the place, it will affect the local directory to enable .htaccess

    Order deny, allow

    Allow from All

< / Directory >

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,

# Error, crit, alert, emerg.

# It is also possible to configure the loglevel for particular

# Modules, e.g.

#LogLevel Info ssl: warn

# For most configuration files from conf-available /, which are

# Enabled or disabled at a global level, it is possible to

# Include a line for only one particular virtual host. For example the

# Following line enables the CGI configuration for this host only

# After it has been globally disabled with "a2disconf".

#Include Conf-available / serve-cgi-bin.conf

< / VirtualHost >

3. Establish links file:

sudo ln -s /etc/apache2/sites-available/test.conf /etc/apache2/sites-enabled/test.conf

Or: sudo a2ensite test.conf

4. Restart the apache server

sudo /etc/init.d/apache2 restart

5. Modify the hosts (/ etc / hosts)

Add www.test.com

Here you can substantially normal to visit!

PS: If there is also the need for directory level URL rewriting support, continue down:

1. Run the terminal

sudo a2enmod

The program prompts for the name of the active module, enter: rewrite

Success will be prompted to rewrite already load

 2. Modify /etc/apache2/sites-enabled/test.conf (the link points to the site configuration file)
Under the AllowOverride property to All, save. (We have already configured for All)

 3. reload apache

sudo /etc/init.d/apache2 restart
- DataGuard Standby backup error RMAN-06820 ORA-17629 to solve (Database)
- Ubuntu Tutorial: How to Upgrade a New Linux Kernel 3.12.7 on Ubuntu (Linux)
- Oracle Linux 5.9 configuration Xmanager (Linux)
- Spring multi data source configuration (Programming)
- CentOS minimal network is unavailable resolved (Linux)
- Ubuntu root user profiles (Programming)
- CentOS yum source deployment (Linux)
- Linux System Administrator common interview questions and answers 30 (Linux)
- Linux Thread Synchronization (Programming)
- ActionContext and ServletActionContext Summary (Programming)
- Installation and Configuration JDK8 In CentOS 7 (Linux)
- Linux operating system security management skills (Linux)
- Ubuntu users to install Xtreme Download Manager (Linux)
- Oracle user lock how to know what causes (Database)
- Java threads in the life cycle (Programming)
- Android project using the command to create and install the package (Programming)
- MBR partitions under Linux (Linux)
- MongoDB common optimization settings in Linux (Database)
- GRUB2 boot Ubuntu Manual (Linux)
- Development environment to build MEAN In Ubuntu 15.10 (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.