Have htdocs/site/ show up at root


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Have htdocs/site/ show up at root
# 1  
Old 08-16-2008
Have htdocs/site/ show up at root

I have a site, www.mySite.com

I have a folder where pages are served from, htdocs/

I have a folder containing one site at htdocs/drupal/. I'd like to be able to go to www.mySite.com and see the index.php page within the drupal folder, but instead I see a directory listing:
drupal
phpBB3

How can I make this index page show up at www.mySite.com, and how can I hide the directory?

I think this is easily accomplished in Apache's config file, httpd.conf, but I can't figure it out.

Thank you so much! This is driving me crazy.
# 2  
Old 08-18-2008
Quote:
Originally Posted by kumakuma
How can I make this index page show up at www.mySite.com
There are many ways to do it. Reading this would help you.
# 3  
Old 08-19-2008
Still confused

Thank you very much for the link. After reading through it, I don't think that's exactly what I need. I want someone to go to www.example.com and see the page that really lives at www.example.com/drupal. I can see how I could redirect them from www.example.com to www.example.com/drupal, but I don't want the name in the address bar in the browser to ever change...

I was looking at RewriteBase inthe .htaccess file in my drupal directory, but wasn't sure if that was the correct way to go.

Sorry, but I'm still confused...

Thanks in advance!

Last edited by kumakuma; 08-19-2008 at 06:00 PM.. Reason: didn't want URLs parsed
# 4  
Old 08-19-2008
It's a really unattractive way to work, but if you don't want the address to ever change, then something like this could be what you want.

index.html:
Code:
<HTML>
<HEAD>
<TITLE>mysite</TITLE>
</HEAD>
<FRAMESET ROWS="*,0">
<FRAME SRC="http://www.mysite.com/drupal" NORESIZE>
<NOFRAMES>
Your browser does not support frames.
</NOFRAMES>
</FRAMESET>
</HTML>

# 5  
Old 08-19-2008
Interesting

Wow, that's a very clever way to get it working! I tried it and it does indeed work. Thank you!

Sorry, I didn't mean I don't want the address bar to never change; I meant I didn't want to redirect visitors from www.mysite.com to www.mysite.com/drupal (which seems fairly easy to do with .htaccess, but then they would see the address bar change).

Ideally, I'd like visitors to be able to go to www.mysite.com and see what is in my public_html/drupal folder. The way I have it now, they would see a directory listing containing a drupal folder and a phpBB3 folder.

Of course, I could accomplish this by moving all the stuff from my drupal folder to public_html folder, but I'd like to keep things organized and keep the drupal site contained within the drupal folder.

I know there's some simple way to do this... I tried creating a symlink of the index.php file in the drupal folder in the public_html folder, but it didn't work.

Seems like I would need the drupal folder to be the RewriteBase for all the links from within the drupal folder to work correctly... (I'm not sure if this is the right variable, but after reading about it in the httpd.conf file, it seems like I'll need to incorporate it.
# 6  
Old 08-19-2008
Isn't it just a virtual domain you need here? If you want anybody visiting www.mysite.com to end up in ~/public_html/drupal/ and want anybody visiting via another alias (like www.mysitephpbb.com) to end up in ~/public_html/phpBB3/ then that would be the simplest solution I'd say...

If that is what you are after, add the following to your config:
Code:
<VirtualHost *>
    ServerAdmin webmaster@mysite.com
    DocumentRoot /path/to/htdocs/drupal
    ServerName www.mysite.com
</VirtualHost>

That should get you close. There's loads of docs out there for virtual hosting under apache
# 7  
Old 08-20-2008
Almost 100% solved!

That's what I was looking for! Thank you very much!

I added the following to my httpd.conf file to test this out:

<VirtualHost *>
ServerAdmin webmaster@mysite.com
DocumentRoot /Applications/MAMP/public_html/someFolder
ServerName localhost
</VirtualHost>

When I visited http://localhost, the index.html file in public_html/someFolder showed up! Thanks again for your help!

However, then I added the following folder and file: public_html/anotherFolder/index.html. When I tried to visit localhost/anotherFolder/index.html, I got a 404 error. Can't other files be served out of the public_html root? I also placed some links in the index.html file residing in someFolder to files nested within someFolder, and those weren't found either...

Last edited by kumakuma; 08-20-2008 at 03:38 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

The square root code I coded on this site...

Hi all, (mainly Neo)... I keep noticing that the SQRT code I wrote recently for a POSIX shell keeps appearing, (the green colour sticks out like a sore thumb). So I decided to take a look on Google. Guess what? UNIX.COM comes first in Google's listing just from two words, see image... (2 Replies)
Discussion started by: wisecracker
2 Replies

2. IP Networking

IPSec Openswan Site to Site VPN - Big Pain

Hi @all, I try to connect 2 LANs with IPSec/Openswan LAN 1: 192.168.0.0/24 LAN 2: 192.168.1.0/24 This is my Config: conn HomeVPN # # Left security gateway, subnet behind it, nexthop toward right. left=192.168.1.29 ... (1 Reply)
Discussion started by: bahnhasser83
1 Replies

3. IP Networking

Does cisco 1921 router support site to site VPNs using IPSec?

Q: "Does Cisco 1921 router support,, act as an endpoint for, site to site VPNs using IPSec? If so, how many? " A: If you get the Cisco 1921/k9 with the security services bundle then it will have built in security features. Cisco, typically includes IP Sec tunnels I believe as part of that... (0 Replies)
Discussion started by: Ayaerlee
0 Replies

4. Shell Programming and Scripting

Find users with root UID or GID or root home

I need to list users in /etc/passwd with root's GID or UID or /root as home directory If we have these entries in /etc/passwd root:x:0:0:root:/root:/bin/bash rootgooduser1:x:100:100::/home/gooduser1:/bin/bash baduser1:x:0:300::/home/baduser1:/bin/bash... (6 Replies)
Discussion started by: anil510
6 Replies

5. UNIX for Dummies Questions & Answers

Why doesn't motd show up when I su to root?

When I do sudo -i isn't that like creating a root login shell session? Why isn't motd displayed? motd=message of the day. ---------- Post updated at 09:54 AM ---------- Previous update was at 09:25 AM ---------- I think I answered it myself, it is only called for remote login sessions, once... (2 Replies)
Discussion started by: glev2005
2 Replies

6. IP Networking

How to establish site to site vpn - Linux machine and cisco asa?

Hi, I am trying to establish vpn between my linux server and cisco asa at client side. I installed openswan on my cent os. Linux Server eth0 - 182.2.29.10 Gateway - 182.2.29.1 eth1 - 192.9.200.75 I have simple IPtables Like WAN="eth0" LAN="eth1" (0 Replies)
Discussion started by: ashokvpp
0 Replies

7. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

8. Solaris

Non-Root mode ... luxadm to show path(s) for Disks

Hi Gurus out there... I am pondering over a situation where I have non-root access (user account), where I am trying to determine paths (including multipaths) on a host. "luxadm display" seems very appropriate, but requires root access. Is there anyway I can get the FC path information? ... (1 Reply)
Discussion started by: verisund
1 Replies

9. IP Networking

port access to site to site VPN

Setup a site to site VPN between two cisco routers. One of the site locations is unable to access ports such as https://example.com:9001 How do I let them go into port 9001? They can ssh, ftp, telnet and everything else. Is this a VPN issue or ACL access issue? I put permit ip host... (0 Replies)
Discussion started by: photon
0 Replies

10. UNIX for Dummies Questions & Answers

Run non-root script as root with non-root environment

All, I want to run a non-root script as the root user with non-root environment variables with crontab. The non-root user would have environment variables for database access such as Oracle or Sybase. The root user does not have the Oracle or Sybase enviroment variables. I thought you could do... (2 Replies)
Discussion started by: bubba112557
2 Replies
Login or Register to Ask a Question