1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Problems creating Virtual Hosts on Centos 7

Discussion in 'Apache' started by Baldur2630, Apr 10, 2017.

  1. #1
    I have a VMWare Server and I use this to create websites for my clients before uploading them to their host.

    I've been using CentOS 7 and Apache 2.2 and it's worked fine. Now I have to create sites with Joomla 3.6 and it wants a version of PHP which isn't available on CentOS 6, so I installed a Centos 7 Server.

    I read several documents on how to achieve this, but I'm getting nowhere fast. This is what I did :

    1. I created a folder in /var/www/html called mysite.
    2. I downloaded Joomla 3.6 anc copied all the files into this folder.
    3. chown -R apache:apache /var/www/html/mysite
    4. chmod -R 755 /var/www/html
    5. In /etc/httpd/conf.d I created a folder mysite.conf
    6. I copied the <VirtualHost> Section from my CentOS 6 to this folder as follows :
    <VirtualHost *:80>
    ServerName mysite.corp.networkingtechnology.org
    DocumentRoot /var/www/mysite
    RewriteEngine On
    RewriteRule ^(/mysite/.*) /www/mysite$1
    ServerAdmin
    ServerAlias mysite
    ErrorLog /var/log/httpd/mysite-error_log
    TransferLog /var/log/httpd/mysite-access_log
    DirectoryIndex index.php
    </VirtualHost>

    7. I have my own (Windows) DNS Servers so I entered mysite into the DNS with the IP Address of 192.168.0.205 so it resolves to mysite.corp.networkingtechnology.org

    It's always worked before, but now I am unable to access the site with a browser.

    Am I missing something here? What am I doing wrong?
     
    Baldur2630, Apr 10, 2017 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    First thing I see is that the folder you're using /var/www/html/mysite is not the same as the one you've defined in your vhost /var/www/mysite
     
    PoPSiCLe, Apr 10, 2017 IP
  3. Baldur2630

    Baldur2630 Member

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    OMG, you're right. Isn't it incredible, you can look at something 50 times and still not spot a stupid error. I fixed it straight away.

    The bad news is that it still doesn't work!
     
    Baldur2630, Apr 10, 2017 IP