LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Crazy issues with configurng Apache 2.0 (https://www.linuxquestions.org/questions/linux-general-1/crazy-issues-with-configurng-apache-2-0-a-615806/)

mikescony 01-23-2008 01:48 PM

Crazy issues with configurng Apache 2.0
 
Hello again Lords of linux:

I am having problems with configuring apache on my rig.
So far the server is running. I can see site pages through
my browser and other rigs that I have on my home network.

Issue is that I can not use a URL I have to input the server IP
and port number. Or input the url along with the port number.

This machine is going to be used locally (intranet) until I gain
more experience with webpage creation. (Don't wanna embarrass maself!!)

so far I have tried editing listen.conf here is the output:

#
#NameVirtualHost *
<namevirtualhost> 192.168.1.103:8001
Listen 192.168.1.103:8001

Here is the output of vhost:
<virtualhost> 192.168.1.103:8001
/<virtualhost>
<virtualhost> 192.168.1.103
/<virtualhost>
<virtaulhost> *:8001
/<virtualhost>
<virtualhost> *
/<virtualhost>

I have tried making these change manually and through YaST (suse 10.1 tool) Yast has been giving me some crazy A$$ errors also when applying
settings I checked permissions and everything checks out.

I need Guidance from above OH LORDS OF LINUX!!!


Distro I am using is suse 10.1
My rig is a IBM Netvista P4 1.8 ghz

ilikejam 01-23-2008 02:17 PM

Hi.

I think you've got the syntax wrong (unless there's been major changes between 2.0 and 2.2). The VirtualHost entry should look something like:
Code:

<VirtualHost *:80>
    ServerName www.example.com
    DocumentRoot /var/www/html
</VirtualHost>

Dave

mikescony 01-23-2008 02:48 PM

Hey Iikejam:
Thanks for the quick reply
Now that entry would that be for vhost.conf or listen.conf
I have moved my document root to /home/xxxxxxx/public_html
and that is why I changed the port number to 8001
I don't have to work as root in this folder. (P.S. I am still a newbie!!)
Lastly this is a intranet site (not for outside viewing at this time.)
Do I really need a FQDN??

ilikejam 01-23-2008 03:03 PM

Hi again.

It shouldn't really matter (from a technical standpoint) which of the config files you put this in, as long as the file is listed in an 'include' directive from the main httpd.conf . listen.conf is probably a good bet, though.

Could you maybe post the contents of httpd.conf and listen.conf?
Code:

egrep -v '^[[:space:]]*#|^$' /etc/httpd/conf/httpd.conf
will give just the interesting bits - change the file name to suit.

Dave

mikescony 01-23-2008 04:05 PM

Man ilikejam your fast!!!:

Here is the revelant info you requested Httpd.conf:
### Virtual server configuration ############################################
#
# VirtualHost: 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:http://httpd.apache.org/docs-2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
Include /etc/apache2/vhosts.d/*.conf

Listen.conf:
- on all addresses and ports. This is your best bet when you are on
# dynamically assigned IP addresses:
#
#NameVirtualHost *
xxxxxxxx 192.168.1.103:8001
Listen 192.168.1.103:8001

Ummm... Looks like I found a new resource (DOH!!!!)

ilikejam 01-23-2008 04:39 PM

Hmmm.

Not quite what I was expecting. httpd.conf is usually about 200 lines long without the comments.
I'm not familiar with SuSE's default apache install, so maybe _all_ the config options are buried in /etc/apache2/vhosts.d . If so, this is going to be difficult to debug. We'll have a bash at it anyway.

So, you can reach the server using the IP and the port number, so it's working in general.

Copy listen.conf somewhere, so we can roll-back if necessary.

Lets say you want to access from your browser 'http://webserver:8001' and have apache serve /home/xxxxxxx/public_html in response to that. (Assuming your web server resolves to 'webserver', of course - adjust to taste).
In that case, you want
Code:

Listen *:8001
NameVirtualHost *:8001
<VirtualHost *:8001>
    ServerName webserver
    DocumentRoot /home/xxxxxxx/public_html
</VirtualHost>

in listen.conf

Try that as the only text in listen.conf, restart apache, and see if you can get to http://webserver:8001 in your browser.

mikescony 01-23-2008 05:00 PM

I have that configured already and that works <virtualhost:8001>
I have also checked the resource I stated earlier URL:http://httpd.apache.org/docs-2.2/vhosts
I am still trying different configs still I have'nt been able to get rid of inputting
the port number..

Ya know I have'nt peirced my ears so why are my brains falling out?? :)

ilikejam 01-23-2008 05:11 PM

Ah, OK. So the virtualhost is working, but it's the port number that you don't want to have to put in the address bar.

You'll have to set up a 301 redirect from '/' to 'http://virtualhost/:8001'
http://httpd.apache.org/docs/2.2/mod....html#redirect

Dave


All times are GMT -5. The time now is 09:21 AM.