Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3291  / 2 Years ago, sun, june 26, 2022, 5:15:55

I know there is plenty of documentation about this, but my problem is different.



I have 2 websites (subdomains) running on one apache2 server.



Site 1 is working fine, site 2 is somehow linked to the apache2 directory /var/www



so when I enter Page 1 I see my page. Page 2 shows me the Apache2 text :



It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.



SO somewhere the link is setup wrong.



Is apache2 only listening to the pages which are in sites-enabled, or is there something more ?



Because on Sites-enabled I just have these 2 pages and NOT 1 link to /var/www
Do I have to setup the different hostnames somewhere else as well ?



thanks in advance.



THIS ONE IS NOT WORKING :



<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/notworking/
ServerName notworking.working.de

RewriteEngine on

<Directory /var/www/notworking/>
RailsBaseURI /notworking
PassengerResolveSymlinksInDocumentRoot on
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
</VirtualHost>


THIS ONE IS WORKING



<VirtualHost *:80>
ServerName working.working1.de
DocumentRoot /data/working/www/

<Directory /data/working/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

More From » 12.04

 Answers
4

I have 2 websites (subdomains)



ServerName working.working1.de <- Working



ServerName xxx.xxxx.de <- Not working



Is it actually a subdomain the one not working? I mean since you do not post the layout of the URL, you should check out if it is an actual subdomain.



Assuming you have the domain working1.de as the working site config depicts, then your not working subdomain should be something like somesite.working1.de



Apache serves the enabled sites (/etc/apache2/sites-enabled) from the pool of available sites (/etc/apache2/sites-available) where actually are symlinks.



When you issue a2ensite mysite_config a symlink is created from sites-available to sites-enabled.



...and it is the default site configuration the one with 'It works!...' where it is enabled by default. You should disable this and keep the file as a reference for future site configurations.



EDIT



As a reference here as a Virtual Host configuration example for two subdomains hosted ad domain.de:



Accesible at http://rails.domain.de



<VirtualHost *:80>
DocumentRoot /var/www/myrailsapp/public
ServerName rails.domain.de

<Directory /var/www/myrailsapp/public>
AllowOverride all
Options -MultiViews
Order allow,deny
allow from all
</Directory>
</VirtualHost>


Accesible at http://another.domain.de



<VirtualHost *:80>
DocumentRoot /var/www/mysite
ServerName another.domain.de

<Directory /var/www/mysite>
AllowOverride all
Options -MultiViews
Order allow,deny
allow from all
</Directory>
</VirtualHost>

[#29815] Tuesday, June 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
attagjump

Total Points: 272
Total Questions: 127
Total Answers: 124

Location: Taiwan
Member since Fri, Sep 17, 2021
3 Years ago
attagjump questions
Tue, Nov 29, 22, 14:19, 1 Year ago
Wed, Jun 22, 22, 07:45, 2 Years ago
Tue, Jun 15, 21, 19:03, 3 Years ago
Thu, Dec 22, 22, 05:47, 1 Year ago
;