Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

problem subdomain debian server 9

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
Vask0
Posts: 2
Joined: 2018-01-16 08:55

problem subdomain debian server 9

#1 Post by Vask0 »

Hello I want to ask why I can not load a subdomain with this script..

this script

Code: Select all


<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName tech.softinfo.org
    ServerAlias tech.softinfo.org
    DocumentRoot /var/www/tech
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


this subdomain does not load a dir /var/www/tech
does any idea why it does not load the desired folder tech? but as you write tech.softinfo.org is loading my main directory softinfo.org (/var/www )

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: problem subdomain debian server 9

#2 Post by pendrachken »

Vask0 wrote:Hello I want to ask why I can not load a subdomain with this script..

this script

Code: Select all


<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName tech.softinfo.org
    ServerAlias tech.softinfo.org
    DocumentRoot /var/www/tech
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


this subdomain does not load a dir /var/www/tech
does any idea why it does not load the desired folder tech? but as you write tech.softinfo.org is loading my main directory softinfo.org (/var/www )

You forgot the quotes around the DocumentRoot path.

Code: Select all

DocumentRoot /var/www/tech
Should be:

Code: Select all

DocumentRoot "/var/www/tech"


It's been years since I used Apache, but I'm fairly sure that is your problem.

The other issue I can think of is if you created the directory you are pointing to without read permissions for group and others. I did this one time and it took me a while to figure out why I couldn't list the contents of the directory but could call a known file from it :oops:


EDIT: also check your DNS, make sure that when you added the subdomain you still have it pointing to both your server IP AND port 80. Also make sure your DNS server isn't just redirecting your subdomain query back to your main domain.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: problem subdomain debian server 9

#3 Post by p.H »

pendrachken wrote:also check your DNS, make sure that when you added the subdomain you still have it pointing to both your server IP AND port 80
The only DNS record type I know which points to a port is SRV. AFAIK it is not used much for websites, most websites use A and/or AAAA records which only point to an IPv4 or IPv6 address respectively.

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: problem subdomain debian server 9

#4 Post by pendrachken »

It depends on the host, some provide redirect servers right through the DNS control interface so that you don't have to set anything else up yourself. It's all done backend and invisible to the user who just has to check a box and specify the forwarded port number.

I've also used some shady DNS hosts before that when calling a subdomain that isn't in an A list, but IS part of a domain that does have an A listing will just forward the address to the main domain instead of throwing an error. Cheap crappy hosting will often do this, or at least they used to. Maybe ICANN has been cracking down harder recently.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P

User avatar
Vask0
Posts: 2
Joined: 2018-01-16 08:55

Re: problem subdomain debian server 9

#5 Post by Vask0 »

In that case, how do I transfer DNS (ip) to load a folder www/var/tech the ip address is the same as the root directory?

what command I need to run in the terminal and which file I need to edit..?

again mention that I use Webmin...

10x

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: problem subdomain debian server 9

#6 Post by pendrachken »

Assuming you have the subdomain set up in DNS, if it points to your main site yet Apache isn't set up properly for your subdomain. Check your config files for the virtual server again for any typing errors.


Also Apache MUST be reloaded after modifying the Apache sites available files and virtualservers. Make sure you have restarted Apachee however your host requires you to restart the service.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P

Post Reply