If this is your first visit, check our documentation. To post, register or login.
Forums / Installing Zen Cart / Installing on a Linux/Unix Server / Help setting up virtual hosts

Help setting up virtual hosts

Started by ckosloff on 14 Aug 2022, 2:00 AM · Views: 3,789

Results 1 to 20 of 21
14 Aug 2022, 2:00 AM
#1
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #1 by ckosloff

I attempted to follow this tutorial but it didn't work.
https://www.tutorialspoint.com/how-to-setup-virtual-hosts-with-apache-web-server-on-linux
I transfered all files form my Zen Cart download, extracted to /var/www/html and renamed folder Zentest, because I am working on a test site.
My project is to install my same local setup on a droplet from Digital Ocean and develop several ZC sites.
Bu I need to master virtual hosting for that.
Please ask me what I did to mess up this first virtual hosting attempt.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

14 Aug 2022, 4:36 AM
#2
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #2 by carlwhat

ckosloff:

I attempted to follow this tutorial but it didn't work.
https://www.tutorialspoint.com/how-to-setup-virtual-hosts-with-apache-web-server-on-linux
I transfered all files form my Zen Cart download, extracted to /var/www/html and renamed folder Zentest, because I am working on a test site.
My project is to install my same local setup on a droplet from Digital Ocean and develop several ZC sites.
Bu I need to master virtual hosting for that.
Please ask me what I did to mess up this first virtual hosting attempt.

if you are running debian and apache2, you need to create virtual hosts config files; and they should be in:

/etc/apache2/sites-available/

that link seems to indicate as such. it also tells you how to enable each config file with the a2ensite command.

i would run:

sudo apachectl configtest

that will tell you if your config is correct.

to solve any problem, one needs to look at log files. and to look at them you need to find them. in debian and running apache2, they should be here:

/var/log/apache2/

if you have overridden your log files, they could be somewhere else; and that location would be in your config file created above.

your log files will tell you where you can find your problems.

start with the config test. if you get the syntax OK response, then look at the log files. if you do not get the syntax OK, correct the errors the configtest reports.

good luck.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

14 Aug 2022, 4:30 PM
#3
doggie avatar

doggie

New Zenner

Join Date:
Apr 2013
Location:
Old Hickory TN
Posts:
10
Plugin Contributions:
0

Post #3 by doggie

Zen cart has been working great for years, I was prompted to change my password I did that but now when I login I get all the info how the setup Zen cart when I used to login I got the page where my order with all the details were placed from my website, I can't get that page to open.

HELP

14 Aug 2022, 4:35 PM
#4
doggie avatar

doggie

New Zenner

Join Date:
Apr 2013
Location:
Old Hickory TN
Posts:
10
Plugin Contributions:
0

Post #4 by doggie

THIS IS TO COMPLICATED, I NED TO TALK TO A TECK, EVERYTHING I HAVE TRIED FAILS. I NEED TO LOGIN O ZEN CART GRT MY INFO PAGE SHOWING MY ORDER FROM MY WEBSITE ( SHIP INFO, CREDI CARD INFO AND SO ON) HOW DO i DO THIS

14 Aug 2022, 7:23 PM
#5
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Post #5 by simon1066

doggie:

Zen cart has been working great for years, I was prompted to change my password I did that but now when I login I get all the info how the setup Zen cart when I used to login I got the page where my order with all the details were placed from my website, I can't get that page to open.

HELP

I don't think this is related to this thread. To get help it would be best if you start a new thread and include the pertinent information asked for in the Posting Tips.

Simon

14 Aug 2022, 10:47 PM
#6
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #6 by ckosloff

AH00558: apache2: Could not reliably determine the server's fully qualified d
omain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppr
ess this message
Syntax OK
This says that problem is not with apache, I think that it is wrong setup of file in sites-available.
Will do a few tries.
Thank you very much for kind support.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

14 Aug 2022, 11:17 PM
#7
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #7 by ckosloff

I think that error arises from sites-available:
<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.example.com

    ServerAdmin webmaster@localhost
        ServerName Zentest.com
    DocumentRoot /var/www/html

    # 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

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # 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>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I think that Document Root line is wrong, by the way I renamed folder in /var/www/html to Zentest.com , it used to be just Zentest, mismatch of names, version is 1.5.7d.

And this is /etc/hosts, not sure about my syntax there.

127.0.0.1localhost 
127.0.1.1crosshair 

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 
192.168.1.84 Zentest.com

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

14 Aug 2022, 11:22 PM
#8
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #8 by ckosloff

After ```
a2ensite Zentest.com

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

14 Aug 2022, 11:53 PM
#9
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #9 by carlwhat

ckosloff:

After ```
a2ensite Zentest.com


when you say it is not working, i'm really not sure what you mean.

you said that you were getting a droplet from digital ocean.  did you get that?  is that the server where these configuration files are?

if i were to ping zentest.com, the response back is from something called hover:

PING zentest.com (216.40.34.41) 56(84) bytes of data.
64 bytes from url.hover.com (216.40.34.41): icmp_seq=1 ttl=45 time=90.2 ms
64 bytes from url.hover.com (216.40.34.41): icmp_seq=2 ttl=45 time=86.8 ms
64 bytes from url.hover.com (216.40.34.41): icmp_seq=3 ttl=45 time=86.4 ms
64 bytes from url.hover.com (216.40.34.41): icmp_seq=4 ttl=45 time=87.2 ms
64 bytes from url.hover.com (216.40.34.41): icmp_seq=5 ttl=45 time=86.7 ms

i do not think hover is part of your setup....  unless i am missing something.

apache may be running and it may serve up the correct web pages, but is anything getting routed to your droplet?

is there anything in:

/var/log/apache2/access.log
or
/var/log/apache2/error.log

sysadmin takes a little bit of work.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

15 Aug 2022, 12:55 PM
#10
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #10 by ckosloff

ServerAdmin webmaster@localhost 
        ServerName Zentest.com 
        SeverAlias www.Zentest.com 
        DocumentRoot /var/www/html/Zentest.com


configtest reports that line with ServerAlias is incorrect, maybe because of the uppercase?
WIll check logs.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

15 Aug 2022, 12:59 PM
#11
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #11 by ckosloff

Now apache service is unavailable, localhost does not display.

[CODE]root@crosshair:~# systemctl status apache2.service 
[B]●[/B] apache2.service - The Apache HTTP Server 
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) 
     Active: [B]failed[/B] (Result: exit-code) since Mon 2022-08-15 08:53:48 EDT; 51s ago 
       Docs: https://httpd.apache.org/docs/2.4/ 
    Process: 3001 ExecStart=/usr/sbin/apachectl start [B](code=exited, status=1/FAILURE)[/B]
        CPU: 20ms 

Aug 15 08:53:48 crosshair systemd[1]: Starting The Apache HTTP Server... 
Aug 15 08:53:48 crosshair apachectl[3004]: AH00526: Syntax error on line 13 of /etc/apache2/sites-enabled/Zentest.com.conf: 
Aug 15 08:53:48 crosshair apachectl[3004]: Invalid command 'SeverAlias', perhaps misspelled or defined by a module not included in the[##############################]>[/COLOR]
Aug 15 08:53:48 crosshair apachectl[3001]: Action 'start' failed. 
Aug 15 08:53:48 crosshair apachectl[3001]: The Apache error log may have more information. 
Aug 15 08:53:48 crosshair systemd[1]: [B]apache2.service: Control process exited, [/B]
```**code=exited, status=1/FAILURE**
Aug 15 08:53:48 crosshair systemd[1]: **apache2.service: Failed with result 'exit-code'.**
Aug 15 08:53:48 crosshair systemd[1]: **Failed to start The Apache HTTP Server.**\[/CODE]****

Typo in ServerAlias, fat fingers.
Still apacheservice does not restart.
****
****```
Aug 15 08:53:48 crosshair systemd[1]: [B]apache2.service: Control process exited, code=exited, status=1/FAILURE[/B] 
Aug 15 08:53:48 crosshair systemd[1]: [B]apache2.service: Failed with result 'exit-code'.[/B] 
Aug 15 08:53:48 crosshair systemd[1]: [B]Failed to start The Apache HTTP Server.[/B]
 

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

15 Aug 2022, 1:28 PM
#12
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #12 by ckosloff

carlwhat:

when you say it is not working, i'm really not sure what you mean.

you said that you were getting a droplet from digital ocean. did you get that? is that the server where these configuration files are?

if i were to ping zentest.com, the response back is from something called hover:

P

i do not think hover is part of your setup.... unless i am missing something.

apache may be running and it may serve up the correct web pages, but is anything getting routed to your droplet?

is there anything in:

/var/log/apache2/access.log
or
/var/log/apache2/error.log

sysadmin takes a little bit of work.

best.

I mean that I am unable to start service, localhost does not display.
Digital Ocean is a project, nothing there yet.
Hover is a canned response from google, you will see it if you type in browser Zentest.com.
I already corrected typo in sites-enabled, still apache does not restart.
I tried re-installing, no luck.
Next step is brute force: purge apache2 and reinstall fresh, something tells me that solution is simpler than that, can it be that a stupid typo messes up things so badly?
Cannot access /var/log/apache2 with GUI.
How see it on command line?

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

15 Aug 2022, 2:20 PM
#13
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #13 by carlwhat

there is no point in looking at the logs if the apache service has not started.

i would keep the server name and server alias all in lower case.

looking at logs? one could use less or tail.

one might need to sudo if one's user is not in right groups.

sudo less /var/log/apache2/access.log

or

sudo tail -f /var/log/apache2/access.log

a more detailed discussion of configuring user and groups is available by searching on-line.

i would also look at hardening your server. i like these guys here:

https://www.cyberciti.biz/tips/linux-security.html

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

15 Aug 2022, 2:20 PM
#14
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #14 by carlwhat

i would not re-install.

solve problems. move forward.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

15 Aug 2022, 9:36 PM
#15
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #15 by ckosloff

SUCCESS!! Localhost is back in all its shining glory.
Problem was in /etc/apache2/apache2.conf
Another typo when trying to correct the alert about "fully qualified domain name".
I typed Server Name instead of ServerName, duhhhh:P

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

15 Aug 2022, 9:49 PM
#16
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #16 by ckosloff

Now I need help editing /etc/hosts.
This is what I have:

127.0.0.1localhost 
127.0.1.1crosshair 

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters

Where does Zentest.com go?
crosshair is the name of my computer.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

16 Aug 2022, 3:25 AM
#17
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #17 by ckosloff

root@crosshair:/etc/apache2/sites-available# ls -al 
total 24 
drwxr-xr-x 2 root     root     4096 Aug 15 23:10 . 
drwxr-xr-x 8 root     root     4096 Aug 15 17:26 .. 
-rw-r--r-- 1 root     root     1332 Aug  8  2020 000-default.conf 
-rw-r--r-- 1 root     root     6338 Aug  8  2020 default-ssl.conf 
-rw-r--r-- 1 ckosloff www-data 1411 Aug 15 23:14 zentest.com.conf 
root@crosshair:/etc/apache2/sites-available# a2ensite zentest.com 
Enabling site zentest.com. 
To activate the new configuration, you need to run: 
  systemctl reload apache2 
root@crosshair:/etc/apache2/sites-available# systemctl reload apache2 
root@crosshair:/etc/apache2/sites-available# apache2ctl configtest 
Syntax OK

SUCCESS!! Everything is in lower case now.
Only thing missing is to edit /etc/hosts/
I think that I should add a newline under the hosts like this:
127.0.0.1 zentest.com.
Will test that tomorrow.
It's late and I am already drunk.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

16 Aug 2022, 2:33 PM
#18
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #18 by ckosloff

ckosloff:

ServerAdmin webmaster@localhost
ServerName Zentest.com
SeverAlias www.Zentest.com
DocumentRoot /var/www/html/Zentest.com

">> 
> configtest reports that line with ServerAlias is incorrect, maybe because of the uppercase?
> WIll check logs.

Probably, that has already been fixed and I got "Syntax OK", there was also a typo in there: Sever instead of Server.
Anyway I am going to add line to /etc/hosts and see if it works.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

16 Aug 2022, 2:56 PM
#19
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #19 by carlwhat

ckosloff:

Probably, that has already been fixed and I got "Syntax OK", there was also a typo in there: Sever instead of Server.
Anyway I am going to add line to /etc/hosts and see if it works.

lowercase is for zentest.com and https://www.zentest.com

apache config are case sensitive, ie:

ServerAlias

having a spelling error, ie:

SeverAlias

is a problem and would need to be fixed.

this is also case sensitive:

DocumentRoot /var/www/html/Zentest.com

that directory must exist and with that same capitalization.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

16 Aug 2022, 10:15 PM
#20
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #20 by ckosloff

ckosloff:

ServerAdmin webmaster@localhost
ServerName Zentest.com
SeverAlias www.Zentest.com
DocumentRoot /var/www/html/Zentest.com

">> 
> configtest reports that line with ServerAlias is incorrect, maybe because of the uppercase?
> WIll check logs.


Uppercase is not the problem, problem is typo SeverAlias instead of ServerAlias

[argentiniansupermarket.com

](http://argentiniansupermarket.com)