http://1.2.3.4/~username

Webgecko

Verified User
Joined
May 2, 2005
Messages
32
Location
In this Forum at the moment.
As many of you may have done, I've changed my default users home from /home to /usr/local/www/

Because of this, I couldn't get /~username to work.

To get this functional again, I've made the following changes to the httpd.conf file. (/etc/httpd/conf/httpd.conf)

FROM THIS

#The default site for the server.
<VirtualHost 1.2.3.4:80>
ServerAdmin webmaster@www.domain.com
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost 1.2.3.4:443>
ServerName localhost
ServerAdmin webmaster@www.domain.com
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key

CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

TO THIS

#The default site for the server.
<VirtualHost 1.2.3.4:80>
ServerAdmin webmaster@www.domain.com
AliasMatch ^/~([^/]+)(/.*)*/usr/local/www/$1/public_html$2
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost 1.2.3.4:443>
ServerName localhost
ServerAdmin webmaster@www.domain.com
AliasMatch ^/~([^/]+)(/.*)* /usr/local/www/$1/public_html$2
DocumentRoot /var/www/html
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key

CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

I then restarted apache and it's now working fine.

Hope it helps.

Cheers!!
 
Back
Top