Apache And Domain Name

Support section for FREESCO v0.3.x 3rd Party Packages

Postby pollo » Mon Oct 22, 2007 10:57 pm

Hello

I searched for this question on the forum but I could not find it although I remember seeing it sometime ago. I installed apache from dingetje’s site and I can access the apache web page by “http://router-ip/apache.html”. I have my dynamic domain name registered. How do I access the apache web pages with domain name? What files do I need to edit and what do I put there?

Thanks

pollo
User avatar
pollo
Junior Member
 
Posts: 34
Joined: Sat Feb 21, 2004 10:34 pm

Postby dilberts_left_nut » Tue Oct 23, 2007 12:10 am

From outside your LAN the dynamic dns name will work.
To use the same name from inside your LAN go into advanced setup -> 41 (DNS SERVER) and add the dyndns name and router internal ip to the file as per the example line.

PS the BOLD 'I' is a TAB if you haven't seen this before (had me stumped when I first started)
User avatar
dilberts_left_nut
Member
 
Posts: 71
Joined: Thu Sep 02, 2004 8:25 am
Location: Christchurch, NZ

Postby Lightning » Tue Oct 23, 2007 1:46 am

You don't have to add anything into the DNS manually. However in the advanced setup under dyndns #49 you do need to enable option #491 to enable local lookup of your dynamic URL. Save this configuration and restart the DNS server with

rc_dns restart
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby pollo » Tue Oct 23, 2007 11:09 am

Lightning,

You don't have to add anything into the DNS manually. However in the advanced setup under dyndns #49 you do need to enable option #491 to enable local lookup of your dynamic URL.

Thanks for your quick reply; it seems to be working although I have not tested it externally ( HTTP server is now set to "y" ). Here are some questions I have again, I am sure they have been asked in this forum but I cant find them;

1) I have two registered domains on both homeip.net and no-ip.com and how do I manage these domain on dyndns.cfg since the file needs one username and one password.

2) What is the command to test if my domain is updating.

3) Do I need to enter these files in dns.cfg and how do I get "www.mydomain.com" to work ?


Thanks
pollo
User avatar
pollo
Junior Member
 
Posts: 34
Joined: Sat Feb 21, 2004 10:34 pm

Postby dingetje » Tue Oct 23, 2007 1:32 pm

One important step to do is to make sure the ServerName directive in Apache's httpd.conf file is set to point to your domain name. Here's mine:

Code: Select all
ServerName dingetje.homeip.net


Also make sure to remove dingetje.homeip.net from the /usr/local/lib/php.ini default cookie domain!

1) dyndns and no-ip are two different free dynamic DNS providers! For dyndns updates you can use the internal DNS update client of FREESCO. For No-ip you can install my no-ip-client package.

2) you can verify updates by the internal DynDNS client by using the web control panel. For the no-ip client you can use command line rc_noip_client restart followed by rc_noip_client status

3) See above
GreetZ
http://dingetje.hopto.org

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
dingetje
FREESCO GURU !!
 
Posts: 1010
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands

Postby Lightning » Tue Oct 23, 2007 7:42 pm

To get "www.mydomain.com" to work, you will have to use the method suggested by Dilberts_left_nut and manually add the entry into the dns.cfg file. When doing this you need to enter the INTERNAL IP address along with all forms or the name you want to use. So the entry will look something like

192.168.1.1 <TAB> www.mydomain.com <TAB> mydomain.com

Also if you have more than one internal interface you will have to add a line for each internal IP address with the same URLs. You also will need to do the same thing for the dynamic DNS account that is not being updated with the built in system.
If you have multiple accounts from the same provider those accounts can be updated by adding the names into a colon separated list. But when using different providers it is beyond what the dynamic DNS was built for, however if you have some knowledge of scripting it is not terribly difficult to change the dyndns script to update both accounts and add a second set of variables into the dyndns.cfg file to use different usernames and passwords for each.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby pollo » Fri Oct 26, 2007 10:21 pm

I have two domains ; class1.homeip.net and class2.homeip.net. I have changed “ ServerName dingetje.homeip.net “on httpd.conf file with my domain “class1.homeip.net” and used class2.homeip.net on VirtualHost as follows;

NameVirtualHost * 80
<VirtualHost * :80>
ServerName class2.homeip.net
ServerAlias  class2.homeip.net
DocumentRoot  /www/class2
### created /www/class2 as a subdirectory
</VirtualHost>


The setup above does not work for me. I can only access the documents in /www if I remove VirtualHost setup. Any idea what is wrong here?

Thanks
pollo
User avatar
pollo
Junior Member
 
Posts: 34
Joined: Sat Feb 21, 2004 10:34 pm

Postby Lightning » Sat Oct 27, 2007 2:34 pm

Try
NameVirtualHost *
<VirtualHost *>
  ServerName class1.homeip.net
  DocumentRoot  /www
</VirtualHost>

<VirtualHost *>
  ServerName class2.homeip.net
  DocumentRoot  /www/class2
</VirtualHost>

Although I would recommend using a completely different directory structure for each virtual server. Which the /boot/ directory will work well for other needed directories.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby pollo » Fri Nov 02, 2007 8:43 am

NameVirtualHost *<VirtualHost *>
  ServerName class1.homeip.net
  DocumentRoot  /www
</VirtualHost>

<VirtualHost *>
  ServerName class2.homeip.net
  DocumentRoot  /boot/class2
### /boot/class2 is a subdirectory  created
</VirtualHost>


I tried the above by creating /boot/class2 subdirectory but it does not seem to work. I do not know what I am doing wrong?

Thanks

po
User avatar
pollo
Junior Member
 
Posts: 34
Joined: Sat Feb 21, 2004 10:34 pm

Postby dRB » Fri Nov 02, 2007 11:41 am

you were close on your first code snippet.

the following is correct:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName class1.homeip.net
ServerAdmin root@localhost
ServerAlias class1.homeip.net
DocumentRoot /www
</VirtualHost>

<VirtualHost *:80>
ServerName class2.homeip.net
ServerAdmin root@localhost
ServerAlias class2.homeip.net
DocumentRoot /boot/class2
</VirtualHost>


and make sure you have added the correct script aliasing if you are using a cgi bin

and make sure you have a directory index in place or the site will be unreachable


/dRB
Please bear with me ... I seemed to have lost my marbles.
User avatar
dRB
Junior Advanced Member
 
Posts: 196
Joined: Tue Apr 30, 2002 2:08 am
Location: Dryden, Ontario. CANADA

Postby Lightning » Fri Nov 02, 2007 11:46 am

Most likely you just have a permissions problem on the directory you created.
Code: Select all
chmod 755  /boot/class2
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby pollo » Tue Nov 06, 2007 10:04 pm

My index.html file is in /boot/class2 ( and chmod 755 ) and upon page request, I get " <span style='color:blue'>The page cannot be found </span>" and my apache error_log says;
[Tue Nov  6 21:29:35 2007] [error] [client 192.168.0.10] File does not exist: /www/boot/class2/index.html

Should I have created the subdirectory under /www ? It seems as if it is looking through /www/boot/class2. What is wrong here?

Thanks

pollo
User avatar
pollo
Junior Member
 
Posts: 34
Joined: Sat Feb 21, 2004 10:34 pm

Postby Lightning » Tue Nov 06, 2007 10:19 pm

It sounds like the virtual hosts is not completely working because the "Documentroot" variable is what decides where to look for that virtualhost. Make sure that this line is above your virtualhost entries.
#
# Use name-based virtual hosting.
#
NameVirtualHost *
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby pollo » Wed Nov 07, 2007 9:57 am

Lightning,
Here is my directive which does not work
# Use name-based virtual hosting.
NameVirtualHost  *:80
<VirtualHost *:80>
ServerName class2.homeip.net
ServerAlias  class2.homeip.net
DocumentRoot  /boot/class2
</VirtualHost>

and gives the error below;
[Tue Nov  6 21:29:35 2007] [error] [client 192.168.0.10] File does not exist: /www/boot/class2/index.html


Thanks
pollo
User avatar
pollo
Junior Member
 
Posts: 34
Joined: Sat Feb 21, 2004 10:34 pm

Postby dingetje » Wed Nov 07, 2007 5:02 pm

Instead of:

Code: Select all
NameVirtualHost  *:80


use

Code: Select all
NameVirtualHost  *


so strip off the :80, you can add specific ports (when using default HTTP then :80 is not needed!) in your virtual host definitions if needed.
Save and restart Apache and try again. Did that change anything?
GreetZ
http://dingetje.hopto.org

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
dingetje
FREESCO GURU !!
 
Posts: 1010
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands

Next

Return to 3rd Party Package Support for FREESCO v0.3.x

Who is online

Users browsing this forum: No registered users and 5 guests

cron