Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
12-26-2002, 12:43 PM
|
#1
|
Member
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102
Rep:
|
Backslash in URL
Just a little question...
Setting up some directories on my server. When I go to:
http://www.cynthiablue.net/fur/forums/
I can reach the page. However, typing in:
http://www.cynthiablue.net/fur/forums
gives me a not available error. How come that last backslash is mandatory, and is there a setting I can change that will allow the URL without a backslash?
Thanks.
|
|
|
12-26-2002, 02:12 PM
|
#2
|
Member
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33
Rep:
|
Hello Cynthia Blue,
Are you running Apache? If so, you can alter the ServerName of your httpd.conf file to allow for the URL to work without the trailing slash... please refer to a previous post:
http://www.linuxquestions.org/questi...threadid=27052
Happy Holidays
|
|
|
12-26-2002, 02:33 PM
|
#3
|
Member
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102
Original Poster
Rep:
|
Ah excellent thank you! I did a search, but didn't know what to search for.
Errrr and yes I'm running Apache.
|
|
|
12-26-2002, 08:51 PM
|
#4
|
Member
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102
Original Poster
Rep:
|
Okay I went to my conf file and tried it... I'm still not able to browse to the directory without a slash. Forgive me, I'm very new to Linux.
My Servername was set to mydomain.com... I changed it to www.mydomain.com, and no change. The Apache page says:
Quote:
If you are using name-based virtual hosts, the ServerName inside a <VirtualHost> section specifies what hostname must appear in the request's Host: header to match this virtual host.
|
I have my main domain name (only one I currently have on there atm), set as the Default Virtual Host. I added a second URL just for fun (it's not real, I figured it can't hurt) in the virutal host section. On my primary URL virtual host section the ServerName is _default_:80. When I try to change this to www.cynthiablue.net, I am unable to restart httpd... the error I get is:
httpd failed. The error was: Stopping httpd: [ok]. Starting httpd (99)Cannot assign requested address: make_sock: could not bind to address 198.IP:80 no listenign sockets aailable, shutting down [failed].
I'm lost.
|
|
|
12-28-2002, 02:49 AM
|
#5
|
Member
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33
Rep:
|
If you are using www.mydomain.com literally, and "hostname" does not reflect www.domain.com, then it will not work. Apache is not going to recognize www.mydomain.com on your server and resolve properly.
Try using your IP number for the ServerName. Use ifconfig to find the IP number for your server.
Just out of curiosity, I see your domain is hosted through Verio, did you have Verio direct your domain to your server?
Thanks.
Last edited by speedracer05; 12-28-2002 at 02:57 AM.
|
|
|
12-28-2002, 10:56 AM
|
#6
|
Member
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102
Original Poster
Rep:
|
My domain name registrar is namesdirect, and my dns manager is verisigndns. I have verisigndns pointing to my static IP provided by my ISP.
I tried the external IP address, and the internal IP address in Server Name.. still not working.
I still can reach my server by typing in my domain name. That seems to work fine reardless of what my ServerName is set to. Hrm.
|
|
|
12-28-2002, 02:28 PM
|
#7
|
Member
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33
Rep:
|
If you shutdown Apache, then try to access your site, are you still able to view your site? It may take a little while for the DNS to be updated before you can actually see your changes.
Can you access your site locally? I mean using http://localhost/fur/forums/? If so, try updating httpd.conf, then restarting, and checking your changes locally.
Thanks.
|
|
|
12-29-2002, 01:28 PM
|
#8
|
Member
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102
Original Poster
Rep:
|
Hmm.. not sure we are understanding each other. I can access my site fine, and I haven't made any changes to my dns manager. Changing the ServerName doesn't seem to be changing whether I can access my site or not. The only problem I'm having, is getting apache to differentiate between a file and a directory. If there is no slash, it thinks it's a file, and I get page not found. If there is a slash, it goes to the right page in the directory.
Maybe I'm not understanding what you mean... Each time I make a change, I've shut down and restarted apache.
Thanks.
|
|
|
12-30-2002, 06:06 PM
|
#9
|
Member
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33
Rep:
|
Sorry for the delay... been doing the holiday travel thing
Please try the following:
/etc/rc.d/init.d/httpd stop
Now try accessing your site:
http://www.cynthiablue.net
Are you able to see your site?
If so, the changes that you make to Apache will not take affect immediately. Otherwise, if you make changes to your ServerName, you will need to wait a little while before your changes take affect.
|
|
|
12-30-2002, 07:11 PM
|
#10
|
Member
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482
Rep:
|
Actually that's a forward slash.
|
|
|
12-30-2002, 09:55 PM
|
#11
|
LQ Newbie
Registered: Dec 2002
Location: Ocean County, NJ
Distribution: Mandrake 9.0
Posts: 22
Rep:
|
I'm having sort of a similar problem. (It mat or may not be related to Cynthia's problem, but I'll throw it out there anyway.)
I put a few pictures in a directory under the html root. When I access it from behind my router, everything is peachy. If I try to access the folder from outside it only works with the trailing "/". It looks like when the "/" is left off, apache tries to send it to the local ip addy (192.168.1.X) instead of the ISP assigned IP or even the name. (I set up an account with No-IP, so I can access my systems without having to try to find the IP address when I'm not at home.
Hopefully this will shed some light on the problem.
|
|
|
12-30-2002, 10:15 PM
|
#12
|
Member
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102
Original Poster
Rep:
|
Per my original post it's not the main domain name that is the problem. It's the subdirectories/filenames.
This:
http://www.cynthiablue.net/fur/
works okay (yeah slash, I always get them confused )
But this:
http://www.cynthiablue.net/fur
Does not (if you click on the links, you will see what I mean.
So, it seems apache thinks that the url with no slash is a file, and cannot find that file, because I don't have a file of that name. It's a directory.
Oh, and yes, if I stop apache, then I cannot see my site. It's pretty instantaneous.
Last edited by Cynthia Blue; 12-30-2002 at 10:18 PM.
|
|
|
12-31-2002, 03:01 PM
|
#13
|
Member
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33
Rep:
|
Okay, I just wanted to make sure that your changes were instantaneous.
If you are behind your router, refering to DeezNutz post, you could use your local IP for the ServerName and the trailing slash problem should be rectified.
Another option would be to use a rewrite rule:
http://httpd.apache.org/docs/misc/rewriteguide.html
Look under "Trailing Slash Problem".
|
|
|
12-31-2002, 03:13 PM
|
#14
|
Member
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102
Original Poster
Rep:
|
My DSL Modem acts as a router...
I'll read over that info, too, thanks.
|
|
|
01-02-2003, 04:08 PM
|
#15
|
Member
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33
Rep:
|
I should have included this in my previous post...
Here is what your httpd.conf should look like with an example rewrite rule for your "fur" directory (assuming that your root directory is /var/www/html):
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes Includes FollowSymLinks
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
#
# HERE IS OUR REWRITE INFORMATION
#
RewriteEngine on
RewriteBase /
RewriteRule ^fur$ fur/ [R]
</Directory>
I hope this helps.
|
|
|
All times are GMT -5. The time now is 01:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|