SunQuest
           Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 27th, 2004, 02:10 PM
majing majing is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 10 majing User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to majing
apache config

assume that i have a file called index.php,a user must login first to gain access of the index.php page,how can i config my apache so that people cannot type the path http://localhost/index.php to access it?
thanks!

Reply With Quote
  #2  
Old February 27th, 2004, 04:59 PM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 12288 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 50 m 48 sec
Reputation Power: 4
RE: apache config

It depends. What kind of login do you use? HTTP authentication or a session-based one made with PHP? If you're using a login system made with PHP, you'll have to solve the problem by modifying the script so that it shows an error if the user hasn't logged in (no changes to Apache config.)

If you're using HTTP authentication, Apache is already configured to do this

Reply With Quote
  #3  
Old February 28th, 2004, 03:02 AM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: apache config

Majing,

This is easily done with a .htaccess file. You can protect an entire directory with this.

first create the password file in the base directory.

-c tells it to create the file. This will prompt you for a password note I added your username. To add users to the file just use it without the -c
Code:
htpasswd -c /var/home/your_dir majing


Then create a file called .htaccess. Below is the basics of what is required in it.
Code:
AuthName "Restricted Directory"
AuthType Basic
AuthUserFile /var/home/your_dir
require valid-user



Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > apache config


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway