0

So I am not sure how this kind of set up it called so it is hard for me to google it and see if I am going in the right direction.

What I have currently

I have a CMS that has a vhost for www.example.com, the admin interface for this is under a sub domain admin.www.example.com.

What I need

Now apart from that CMS I need to have a forum platform up and running. This is how would like it to be set up

  • www.example.com -> CMS
  • www.example.com/advice -> forum

Is a set up like this possible with apache?

Details

I am running on centos7 with apache 2.4.6.

My current vhost is like the following

<VirtualHost *:80>
   ServerName example.com
   DocumentRoot /www/example.com
   SetEnv ADMIN_DOMAIM 0
   <Directory "/www/example.com>
              AllowOverride All
              Options FollowSymLinks
   </Directory>
   php_value mbstring.func_overload 0
   DirectoryIndex index.php
</VirtualHost>

<VirtualHost *:80>
   ServerName admin.example.com
   DocumentRoot /www/example.com
   SetEnv ADMIN_DOMAIN 1
   <Directory /www/example.com>
              AllowOverride All
              Options FollowSymLinks
   </Directory>
   php_value mbstring.func_overload 0
   DirectoryIndex index.php
</VirtualHost>

<VirtualHost *:443>
        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
        SSLCertificateFile /etc/pki/tls/certs/localhost.crt
        SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
        SetEnv ADMIN_DOMAIN 0
        ServerName example.com
        DocumentRoot /www/example.com
        <Directory /www/example.com>
              AllowOverride All
              Options FollowSymLinks
        </Directory>
        php_value mbstring.func_overload 0
        DirectoryIndex index.php
</VirtualHost>

<VirtualHost *:443>
        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
        SSLCertificateFile /etc/pki/tls/certs/localhost.crt
        SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
        SetEnv ADMIN_DOMAIN 1
        ServerName admin.example.com
        DocumentRoot /www/example.com
        <Directory /www/example.com>
              AllowOverride All
              Options FollowSymLinks
        </Directory>
        php_value mbstring.func_overload 0
        DirectoryIndex index.php
</VirtualHost>
3

Just create a directory called "advice" inside DocumentRoot (/www/example.com in your case) and install the forum platform there.

Also for the CMS to ignore that directory, you need to add the following to the .htaccess located inside of advice RewriteCond %{REQUEST_FILENAME} !-d

5
  • hmm I try this one out, but I might run into some issues from the router of the CMS. do you have any other solutions that might work out?
    – Steve
    Nov 23 '16 at 13:57
  • Routers don't care about URL's. Your DNS record should resolve to your website and the website will then be responsible for "directing" the requests.
    – joeqwerty
    Nov 23 '16 at 14:00
  • Yes you can create another virtual host and install forum platform in another domain. But this requires to register one more domain (say example2.com). Regarding the router issue you can instruct your web server to ignore requests received for the directory "advice". Usally this is done on the .htaccess file using the following Rewrite condition. RewriteCond %{REQUEST_FILENAME} !-d Nov 23 '16 at 14:01
  • @joeqwerty I was refaring to the CMS router (request handler)
    – Steve
    Nov 23 '16 at 14:08
  • @VikelidisKostasThat worked perfectly.
    – Steve
    Nov 23 '16 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.