Apache2.4.6 (CentOS 7) – Create Virtual Hosts

The instructions below show how to create virtual hosts in Centos 7. In this case the virtual hosts will be running from a custom location in the system and not from directories created in the /home directory.

Edit/Create your Virtual Host file
Create/edit the following file by entering the following line. This will tell httpd to read the configuration for the actual virtual hosts, provided of course that the main httpd.conf file is instructed (usually by default) to read the files in ‘conf.d/*.conf’ directory.

vim /etc/httpd/conf.d/vhosts.conf
IncludeOptional vhosts.d/*.conf

Create the directory where the config files for the Virtual Hosts will reside.

mkdir /etc/httpd/vhosts.d

Create the config file for your first Virtual Host.

vim /etc/httpd/vhosts.d/rpmsrepo.sfentona.lol.conf

Include the following lines in the config file.

<VirtualHost *:80>
 ServerAdmin webmaster@dummy-host.example.com
 DocumentRoot /repo/Centos06/centos/
 ServerName rpmsrepo.sfentona.lol
 ServerAlias www.rpmsrepo.sfentona.lol

<Directory "/repo/Centos06/centos/">
 DirectoryIndex index.html index.php
 Options FollowSymLinks
 AllowOverride All
 Require all granted

Create the directories where your virtual hosts will be running from
mkdir /repo/Centos06/centos/
chown -R apache:apache /repo/Centos06/centos/
chmod 755  /repo/Centos06/centos/

Check your httpd configuration and start httpd

apachectl configtest
systemctl restart httpd
systemctl status httpd
Share Button

Centos 6.5 – Create a YUM repository for your private network.

This tutorial shows how to create a YUM repository which you can use on your own private network. You may want this if you do not want your production servers to reach on the Internet thus keeping them protected. These servers will get their RPM packages by a server that holds the always up to date RPM packages. This is called the repository server and it will need access to the Internet in order to get the latest RPM packages.



1) Find an official CentOS site that supports RSYNC. List of Links here.

2) Have a spare server to use as your Repo server. This server will need to have Apache installed.

3) Enter an DNS entry for the local web site you will create that will host the RPM packages.

4) Setup yum on your servers to get the new packages from your Repo Server.

Continue reading

Share Button