Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Ubuntu Apache virtual host configuration     - Linux system boot process ARM platforms (Linux)

- Port is not being used, how will bind failure? (Server)

- Linux network monitoring strategy (Linux)

- SQL Server 2008 database synchronization Notes (Database)

- CentOS RedHat YUM Source Extensions Supplement (including 32-bit, 64-bit) (Linux)

- Wi-Fi hackers use to attack your seven methods (Linux)

- Ubuntu 14.04 compile and install Apache (Server)

- Mumble installation source VoIP application on Ubuntu (Linux)

- Ubuntu 14.04 set auto sleep time (Linux)

- Android webView URL redirects affect goBack () (Programming)

- Oracle table compression Technology Introduction (Database)

- Linux System Getting Started Learning: The Linux command line burn ISO or NRG image to DVD (Linux)

- How to set IonCube Loaders in Ubuntu (Linux)

- Oracle RAC node on the expulsion of the inspection process on OEL6.3 (Database)

- To build Spring RestTemplate use HttpClient4 (Programming)

- Vagrant Getting Start (Linux)

- Install Oracle 11g illustrations and dependent libraries under SUSE11 (Database)

- RHEL7 Apache MPM configuration (Server)

- Installation Mesos + Marathon + Zookeeper under CentOS 7 (Server)

- Hibernate Search 5.5 in the search results sorted (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 127.0.0.1 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
     
         
         
         
  More:      
 
- Explore Android SQLite3 multithreading (Programming)
- Docker command Detailed (Linux)
- Detailed Linux su command to switch users Mistakes (Linux)
- CentOS iptables firewall configuration (Linux)
- The Oracle VM VirtualBox use U disk under ubuntu (Linux)
- Node.JS different ways to install under Ubuntu 15.04 (Linux)
- CentOS 6.4 installation and configuration LNMP build PHP server runtime environment (Server)
- Linux excellent text editor (Markdown, LaTeX, MathJax) (Linux)
- Virtual Judge environment to build and configure under Ubuntu (Server)
- Restrict console access to Linux servers to improve security (Linux)
- VMware Workstation virtual machine cloning (Linux)
- Linux Network Programming - raw socket programming (Programming)
- Ubuntu 10.10 install Oracle 10g graphic tutorials (Database)
- Killall five options you might not know (Linux)
- Samhain: Powerful intrusion detection system under Linux (Linux)
- Build the first ASP.NET 5 Web project in Mac OS X Yosemite 10.10.3 (Server)
- Sublime Text 3 practical functions and shortcut keys used to collect (Linux)
- Experience RHEL7 new features (Linux)
- How to install Kernel 4.0.2 on CentOS 7 (Linux)
- Android Studio and Git Git configuration file status (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.