Does wampserver support multiple website / cms ?
Posted by: stankovic1 (---.ohtele.com)
Date: October 23, 2016 07:36PM

I really don't know if this is the right place to ask this question, I hope the mods forgive me if I made a mistake by asking here. This might seem like a silly question but some months back I installed wampserver and then installed opencart CMS (in the www directory in wamp ) which I used to successfully carry out a project, fast forward today and I tried installing wordpress in the www directory and I kept getting an error message and then I tried to access the project I was working on with opencart and I found out that the project had been destroyed, I kept getting error messages. So I would like to know if this is because wamp can't support multiple projects (websites / cms) in the www directory. would appreciate some response.

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: Otomatic (Moderator)
Date: October 23, 2016 09:13PM

Hi,

As for all hosts to have multiple sites, use the VirtualHost.

WampServer is a web host, therefore, to manage as many sites as you wish, it is necessary to also use the VirtualHost.
See: The need for Virtual Host

However, for this to work with the minimum of problems, it is better to "build" a VirtualHost before installing a CMS or web application.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 10/24/2016 09:41AM by Otomatic.

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: RiggsFolly (Moderator)
Date: October 24, 2016 10:01AM

If you installed one site over the top of another site, then what did you expect.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: stankovic1 (169.159.98.---)
Date: October 24, 2016 12:13PM

@riggsfolly, I am new to using wampserver, I am just hearing about this virtual host thing for the first time.

@otomatic thanks for your response, how do I make use / build this virtual host? Like I said earlier on, I am just seeing all this for the first time as I am new to wampserver

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: RiggsFolly (Moderator)
Date: October 24, 2016 12:22PM

Apache Virtual Hosts are not a WAMPServer thing!

They have been around for years and are an Apache concept.


Oto pointed you to a document explaining Virtual Hosts on this site. The concept is also documented on the Apache site.

If you are using WAMPServer3 we even created a tool to make the process even more simple than it already was. See the second post in this document [forum.wampserver.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: stankovic1 (154.66.61.---)
Date: October 31, 2016 09:18AM

I configured virtual host, I tried accessing my local host after configuring virtual host and i got the error message

"Forbidden

You don't have permission to access / on this server.
Apache/2.4.17 (Win64) PHP/5.6.16 Server at localhost Port 80"



This is what my httpd-vhosts.conf look like

"# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:[httpd.apache.org];
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias www.localhost.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/my-site/"
ServerName my-site
ServerAlias my-site
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/teststore/"
ServerName teststore
ServerAlias teststore
</VirtualHost>


"

My hosts file looks like this :

"# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost



127.0.0.1 localhost
127.0.0.1 my-site
127.0.0.1 teststore

"


I am not sure what I am doing wrong here, I would appreciate if someone could point out where I got this wrong.

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: Otomatic (Moderator)
Date: October 31, 2016 10:38AM

Hi,

You didn't create your VirtualHost by Wampserver!

httpd-vhosts.conf file should be :
# Virtual Hosts
#

<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot c:/wamp/www
  <Directory  "c:/wamp/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>
#
<VirtualHost *:80>
   ServerName my-site
   DocumentRoot c:/wamp/my-site
  <Directory "c:/www/my-site/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride all
    Require local
  </Directory>
</VirtualHost>
#
<VirtualHost *:80>
   ServerName teststore
   DocumentRoot "c:/www/teststore"
  <Directory "c:/www/teststore/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride all
    Require local
  </Directory>
</VirtualHost>
and hosts file should be
127.0.0.1 localhost
127.0.0.1 my-site
127.0.0.1 teststore
::1 localhost
::1 my-site
::1 teststore

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: stankovic1 (169.159.96.---)
Date: October 31, 2016 09:38PM

Hi Otomatic
I dd everything just as you said I should but I am still getting the error message - "Forbidden

You don't have permission to access / on this server.
Apache/2.4.17 (Win64) PHP/5.6.16 Server at localhost Port 80"

I guess I would have to reinstall wampserver and start afresh.

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: Otomatic (Moderator)
Date: November 01, 2016 09:58AM

Hi,

> I guess I would have to reinstall wampserver and start afresh.
Why ?

When changing or adding names to the hosts file so that these are taken into account, you must either reboot or restart the local DNS.
This can be done by:
- Right click Wampmanager tray icon -> Tools -> Restart DNS.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: stankovic1 (160.152.5.---)
Date: November 01, 2016 02:27PM

Hi Otomatic, I have been going about this the wrong way, I was following the guide to creating virtual host in older wampservers, I came across the link here [forum.wampserver.com] and decided to use that method as my wampserver is version 3.0.0 64bit . Everything was going well until I got to the page [localhost] where "Name of the Virtual Host No diacritical characters (éçëñ) - No space - No underscore(_)" and "Complete absolute path of the VirtualHost folder Examples: C:/wamp/www/projet/ or E:/www/site1/" is located. in "complete absolute path" I typed in c:/storefolder but got an error message c:/storefolder does not exists or is not a directory, tried again with C:/wamp/www/storefolder/ got the same message, I even created the folder storefolder and yet it still gave me the error message - c:/wamp/www/storefolder does not exists or is not a directory. This seems like something really easy to do but I don't know why I am encountering all these problem.

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: Otomatic (Moderator)
Date: November 01, 2016 04:25PM

Hi,

> c:/wamp/www/storefolder does not exists or is not a directory
- Your session must be an administrator session.
- Not only must be in as an administrator, but in addition, you must verify that such administrator is owner of C: and c:/wamp/www/storefolder with total control.
I know it sounds silly, but the administrator is not necessarily the owner of the disk, the folder or the file.
See (Note 2) of TROUBLESHOOTING TIPS
The explanation is for C:\Windows\System32\drivers\etc\hosts but it is the same for any other file or folder or disk.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: stankovic1 (160.152.5.---)
Date: November 01, 2016 05:31PM

So are you saying I have to uninstall wampserver and then reinstall but this time as administrator? and then change the rights to c:/wamp/www/storefolder through the following steps

"right-click on "C:\Windows\System32\drivers\etc\hosts", Security then Properties, Advanced, Owner."

Am I right?

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: Otomatic (Moderator)
Date: November 01, 2016 06:28PM

Hi,

> So are you saying I have to uninstall wampserver and then reinstall but this time as administrator?
YES !
You must be an administrator in session and start the installation as an administrator.
Right-click the executable file and run as administrator.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: stankovic1 (154.66.55.---)
Date: November 04, 2016 09:19AM

I have finally been able to create a virtual host, thanks Otomatic, My virtual host teststore appears under localhost at the homepage, when I click on my virtual host - teststore I get a message that says

"Not Found

The requested URL / was not found on this server.
Apache/2.4.17 (Win64) PHP/5.6.16 Server at teststore Port 80"

I am guessing this is because I have installed anything in the storefolder yet, Anyway so if I was going to create a CMS / ecommerce store on my virtual host, do I create it inside the storefolder, also if I want to create more virtual hosts, do I follow the same exact steps I used to create the current virtual hosts?

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: Otomatic (Moderator)
Date: November 04, 2016 09:38AM

Hi,

You must create a VirtualHost before installing any CMS or Web application.

You can have as many VirtualHost as you want. Simply create each VirtualHost before installing the web application.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: stankovic1 (105.112.22.---)
Date: November 04, 2016 05:43PM

Yes, I know I have already created a virtual host called teststore, while creating I was asked for sitename and sitefolder, I created a folder called storefolder assigned administrator rights and then used that as my sitefolder. My question now is this - would I be installing my CMS inside the storefolder (C:\wamp64\www\storefolder) ?

Options: ReplyQuote
Re: Does wampserver support multiple website / cms ?
Posted by: Otomatic (Moderator)
Date: November 04, 2016 06:05PM

Hi,

> installing my CMS inside the storefolder (C:\wamp64\www\storefolder) ?
What is the procedure for installing the CMS?
In principle, this is explained on the CMS website or in a readme file obtained after unzipping the downloaded file.
For most CMS like Joomla for example, simply unzip the archive in the VirtualHost folder then launch it.

So, unzip the CMS inside C:\wamp64\www\storefolder\ the launch the VirtualHost storefolder if it is the ServerName you gave to it.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.