Tag: public_html
Introduction to Web Hosting
by admin on Jan.30, 2012, under Tutorial
How your site works
Your web site is made up of a group of files and directories, much like your Documents folder on your home computer. Only in this case, everyone in the world can see some of your files. To give you an idea of how the directories and files work, we’ll look at a view of the file manager.
Contents of /usr/home/username/.
Above, you can see an example of the files and directories in your site. There are three main directories to be concerned with:
home /usr/home/username/ – This is your home directory. All of your files are stored within this directory. Files placed directly in this directory will not be visible on the internet. You will start out in your home directory when connecting by FTP, Web Disk or the File Manager.
/usr/home/username/public_ftp/ – This is the directory used for anonymous FTP access. Any files in this directory can be downloaded by anyone if anonymous FTP access is enabled.
public_html /usr/home/username/public_html/ (www) – The public_html directory contains the files for your site. Files in public_html and any subdirectories of public_html will be able to be viewed by anyone on the internet.. (/usr/home/username/www/ is the same directory as /usr/home/username/public_html/).
When someone views a directory in your public_html area, they will see the index page for that directory. When creating your index page, you should use one of the following names (the first one found will be shown if the visitor doesn’t type in a specific page in their URL):
index.php
index.html.var
index.htm
index.html
index.shtml
index.xhtml
index.wml
index.perl
index.pl
index.plx
index.ppl
index.cgi
index.jsp
index.js
index.jp
index.php4
index.php3
index.php
index.phtml
default.htm
default.html
home.htm
index.php5
Default.html
Default.htm
home.html
Warning: When adding files to your site, it is important that you add them in the right place. For example, you will need to place files that you wish to be visible on the internet in public_html or a subdirectory of public_html. If you placed them in / for example, no one will be able to view them.
How do I change the DocumentRoot of only one of my subdomains?
by admin on Jan.23, 2012, under DirectAdmin
1) If you wish to change just 1 subdomain path, you’d use this guide as a starting point:
http://help.directadmin.com/item.php?id=3
and insert the following code
|*if SUB="subname"|
|?DOCROOT=/the/new/path/you/want|
|*endif|
This will do a check on the subdomain name.
Change subname to the name of the subdomain you want to set the path for.
Also change the path to the path you’d like.
Failing to use the if statement on the subdomain will cause the main domain and all subdomains to use this new path, which isn’t always as desired.
2) Going into more detail, the DocumentRoot for a subdomain will always have the "sub" name appended to the end. If this is not the desired effect, then the templates would have to be modified to get rid of the bit on the end, while still allowing subdomain paths for normal subdomains to be valid. To do that, first copy the templates to the custom folder
cd /usr/local/directadmin/data/templates/custom
cp ../virtual_host2*_sub.conf
Then edit both of the virtual_host2_sub.conf and virtual_host2_secure_sub.conf files. Find the following line:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
and change it to be:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html/`SUB`|
Same thing for this line:
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/`SUB`/cgi-bin/|
change it to be:
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
and one last time for a 3rd line, change:
<Directory |DOCROOT|/|SUB|>
to be:
<Directory |DOCROOT|>
Save the 2 virtual_host2*_sub.conf with these 3 changes, then proceed with step 1 normally, and the path will be what you’re looking for. All existing subdomains will also remain unaffected, since we just moved the SUB part from the bottom, and moved it to the top.
3)Similarly, if you only which to change the path of the domain and not any subdomains, you can use
|*if !SUB|
|?DOCROOT=/the/new/path/you/want|
|*endif|
so that only if there is no subdomain name, then the path will be altered.
