Re: domain.com/~user -> user.domain.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>What does "does not work" mean???
Takes me to the "main page"

>>Couple of points:

>>- do you have mod_rewrite? (cf. IfModule...)
Yes
>>- why does this need to go in a .htaccess file? 
B/C i can not get a vhost working so i thought this might work

>>It will only be used if the directory is accessed - are you sure that is happening? Better is to
>>put it into the main config.
I have this code in the .htaccess file that is located in the main site (i thought this way, when it sees user.domain.tld, it would rewrite? Now that i say that out-loud, that doesn't sound right :)

>>- The Big One: this whole user.domain.com -> www.domain.com/~user will
>>only work if you have registered user.domain.com in DNS to point to an
>>IP you are listening to (usually same as www.domain.com). 
Yes, i have it in a public DNS and our private DNS. In our private DNS, it is a wildcard (*.domain.tld)
>>BTW, this is
>>why "does not work" is annoying - if you had said, "I get Bad Gateway",
>>then we would know you had not set up DNS. If you said "I just get
>>www.domain.com" then we'd know it was something in the config...
Forgive me of breaking rule #1. See above answer (take me to the main page)

I have a vhost like this also (does not work):
<VirtualHost *:80>
    ServerAdmin user@xxxxxxxxxx
    ServerName user.domain.tld
    DocumentRoot /home/<user>/public_html/

    # if not specified, the global error log is used
    ErrorLog /var/log/apache2/user.domain.tld-error_log
    CustomLog /var/log/apache2/user.domain.tld-access_log combined

    # don't loose time with IP address lookups
    HostnameLookups Off

    # needed for named virtual hosts
    UseCanonicalName Off

    # configures the footer on server-generated documents
    ServerSignature On


    # Optionally, include *.conf files from /etc/apache2/conf.d/
    #
    # For example, to allow execution of PHP scripts:
    #
    # Include /etc/apache2/conf.d/mod_php4.conf
    #
    # or, to include all configuration snippets added by packages:
    # Include /etc/apache2/conf.d/*.conf


    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    #
    ScriptAlias /cgi-bin/ "/srv/www/vhosts/dummy-host.example.com/cgi-bin/"

    # "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have one, and where ScriptAlias points to.
    #
    <Directory "/srv/www/vhosts/dummy-host.example.com/cgi-bin">
	AllowOverride None
	Options +ExecCGI -Includes
	Order allow,deny
	Allow from all
    </Directory>


    # UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received.
    #
    # To disable it, simply remove userdir from the list of modules in APACHE_MODULES
    # in /etc/sysconfig/apache2.
    #
    <IfModule mod_userdir.c>
	# Note that the name of the user directory ("public_html") cannot simply be
	# changed here, since it is a compile time setting. The apache package
	# would have to be rebuilt. You could work around by deleting
	# /usr/sbin/suexec, but then all scripts from the directories would be
	# executed with the UID of the webserver.
	UserDir public_html
	# The actual configuration of the directory is in
	# /etc/apache2/mod_userdir.conf.
	Include /etc/apache2/mod_userdir.conf
	# You can, however, change the ~ if you find it awkward, by mapping e.g.
	# http://www.example.com/users/karl-heinz/ --> /home/karl-heinz/public_html/
	#AliasMatch ^/users/([a-zA-Z0-9-_.]*)/?(.*) /home/$1/public_html/$2
    </IfModule>


    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "/home/<user>/public_html/">
    
	#
	# Possible values for the Options directive are "None", "All",
	# or any combination of:
	#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
	#
	# Note that "MultiViews" must be named *explicitly* --- "Options All"
	# doesn't give it to you.
	#
	# The Options directive is both complicated and important.  Please see
	# http://httpd.apache.org/docs-2.2/mod/core.html#options
	# for more information.
	#
	Options Indexes FollowSymLinks
    
	#
	# AllowOverride controls what directives may be placed in .htaccess files.
	# It can be "All", "None", or any combination of the keywords:
	#   Options FileInfo AuthConfig Limit
	#
	AllowOverride None
    
	#
	# Controls who can get stuff from this server.
	#
	Order allow,deny
	Allow from all
    
    </Directory>

</VirtualHost>

Chris

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux