Jump to content

Apache2 and .htaccess


Mike Miller

Recommended Posts

Hi all,

 

I currently run a small IRC server (irc.website.com). irc.website.com resolves to 10.20.30.40. The IRC server has the following stuff in it (/home/website):

 

ircd/

logs/

public_html/

services/

passwd (linked in .htaccess)

 

Under /public_html is a sub-folder called logs, which has two folders: channel-logs and private-logs. The .htaccess file is under /public_html/logs. Here's the stuff in it:

AuthName "Enter Password"
AuthType Basic
AuthUserFile /home/website/passwd
Require valid-user

I have a VirtualHost set up for irclogs.website.com (I have to distribute this link to others) that uses the .htaccess info to log in. However, when irc.website.com is typed into the browser, it prompts me for a username/password, and uses the .htaccess file under /public_html/logs.

VirtualHost:

NameVirtualHost 10.20.30.40:80

<VirtualHost 10.20.30.40:80>
        ServerName irclogs.website.com
        ServerAlias irclogs.website.com
DocumentRoot /home/website/public_html/logs
ServerAdmin webmaster@website.com
        UseCanonicalName Off

#DocumentRoot /home/website/public_html/logs
#Directory /home/website/public_html/logs
#AuthDBMUserFile /home/website/passwd

<Directory />
	Options FollowSymLinks
	AllowOverride None
</Directory>
<Directory /home/website/public_html/logs>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride AuthConfig
	Order allow,deny
	allow from all
                AuthName "Private"
                AuthType Basic
                AuthBasicProvider dbm
                AuthDBMUserFile /home/website/passwd
                Require valid-user
</Directory>
ScriptAlias /cgi-bin/ /home/website/public_html/cgi-bin/
<Directory "/home/website/public_html/cgi-bin/">
	AllowOverride None
	Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
	Order allow,deny
	Allow from all
</Directory>

ErrorLog /home/website/logs/website_error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /home/website/logs/website_access.log combined
        CustomLog /home/website/logs/website.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
ServerSignature On

</VirtualHost>

Basically, I don't want "irc.website.com" to be accessible from the browser. I only want that to be used when users are connecting to the IRC server. I'm not too good with VirtualHosts (still getting the hang of it). OS = Ubuntu with Apache2.

 

Any help is appreciated. Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.