Wednesday, January 13, 2010

How To Get A Gecko To Eat A Pinkie

Site on dynamic virtual local host [02-03 ] - Fedora How-to






Virtual hosts on the local

We come to this point to the creation of virtual hosts

. Apache handles content locally folder / var / www /
, which is not exactly the best placement.
To make sure that Apache can reach, but also manage content
outside of this folder

is necessary to make some changes to the configuration file
.
Those proposals are the minimum necessary for the functioning of all, in addition, the permissions are applied

assume that there are problems of user access , that there is the need for special restrictions for specific users.
If so, the more detailed documentation, which deals with these issues, which were drawn from the information below you will find here (the site of Miranda)
, here (Apache - userdir) and
here (Apache - Public Folders)

.

We identify or create a folder where first of all we are interested to enter the material.
The syntax provides for the obligation of using the name
public_html , which is to provide a path like / ... / Public_html / foldername) but under the aspect of functionality is not strictly necessary. Then you do. Let's try , for example, and download the current stable version 1.5 in Italian: Joomla_1.5.15_ita-Stable.tgz
. in NB I have a 500 GB HD with multiple partitions, one of only 350GB of data formatted in EXT3
, this partition is the ideal for me to park a bit 'of sites for testing and development. So I created within this folder Serverspace
. Since the partition, called HD350GB is mounted in / media directory, the path absolute in this folder will / media/HD350GB/Serverspace . Once downloaded, I unzipped the downloaded file by Joomla! in a folder called joomla15ita
, which I cut and pasted within the folder Serverspace, obtaining the absolute path / media/HD350GB/Serverspace/joomla15ita . So I created, since that was missing (but in this case is not essential), the folder cgi-bin
joomla15ita within the folder. At this point, I typed in console root: # chmod 755-R / media/HD350GB/Serverspace # chmod 701-R /-R media/HD350GB/Serverspace/joomla15ita/cgi-bin
The recursive extended permissions to all folders, and this, that the allocation of permits, is crucial to the success of the initial automatic configuration of Joomla!, especially for the folder and the file Installation configuration.php to content 'inside the site. at this point to be created the alias , ie alternative pointers Apache, so I typed: # gedit / etc / httpd / conf.d / alias
and I put in the file, according to the syntax alias
/ URL-path / directory_del_file /
, the following lines: Alias \u200b\u200b / joomla15ita / media/HD350GB/Serverspace/joomla15ita
§ Directory / Media/HD350GB/Serverspace/joomla15ita §
Options Indexes FollowSymLinks AllowOverride All Order allow, deny Allow from all § / § Directory
The interesting thing is that if I other sites contained in other folders named, for es. sito02, sito03, etc.. and copy these folders within the folder Serverspace, after entering into the cgi-bin if it is missing and assigned permissions as before, I just put in the same file
other groups of commands like: Alias \u200b\u200b/ sito02 / media/HD350GB/Serverspace/sito02 § Directory / media/HD350GB/Serverspace/sito02 § Options Indexes FollowSymLinks
AllowOverride All Order allow, deny Allow from all § / § Directory
etc.. to make sure that Apache will recognize them.





But this step is not enough : You must also intervene in the heart of Apache configuration, ie in the httpd.conf file
# gedit / etc / httpd / conf / httpd.conf First of all we do is that the path / media/HD350GB/Serverspace /, as well as existing, is enabled

; to get it, you must enable, in the range of the line 350, function
UserDir , commenting (ie beginning of the sentence by inserting the hash mark #) the line "UserDir disabled", and uncomment the final line UserDir, affixing
the path of our interest, as shown below as an example:

§ IfModule mod_userdir .
c §
# # UserDir is disabled by default since it can confirm the presence # of a username
on the system (
Depending on home directory # permissions).
#
# UserDir disabled #
# To enable requests to / ~ user / to serve the user's public_html # directory, remove the "UserDir disabled" line above, and uncomment # The following line INSTEAD: # UserDir / media / HD350GB/Serverspace
§ / IfModule §

Come to this point of nell'intorno

line 975 which has the command NameVirtualHost *: 80 and decommentiamolo (ie we remove the hash mark # at the beginning of the sentence).


# NameVirtualHost *: 80 #


nell'intorno of
then go online and insert the 996

virtualhost § # VirtualHost *: 80 # §
ServerAdmin webmaster@dummy-host.example.com # DocumentRoot / www / docs / dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs / dummy-host.example.com -error_log # CustomLog logs / dummy-host.example.com -access_log common #§/VirtualHost§
§VirtualHost *:80§
DocumentRoot /media/HD350GB/Serverspace/joomla15ita
ServerName joomla15ita ScriptAlias /cgi-bin/ "/media/HD350GB/Serverspace/joomla15ita/cgi-bin/" §Directory /media/HD350GB/Serverspace/joomla15ita§ AllowOverride All Options All §/Directory§ §/VirtualHost§

§VirtualHost *:80§
DocumentRoot /media/HD350GB/Serverspace/sito02
ServerName sito02
ScriptAlias /cgi-bin/ "/media/HD350GB/Serverspace/sito02/cgi-bin/"
§Directory /media/HD350GB/Serverspace/sito02§
AllowOverride All Options All

§ / Directory
§ § / § VirtualHost

etc..

I recommend: Let the gates only in the initial sample strings (like the first block above, which will already be set in the script), remembering that a line that starts with a pound sign is interpreted as a simple statement as an instruction rather than irrelevant program.

At this point you quit gedit saving the file httpd amended, and launching the

restart Apache (the restart must be done every time you edit the httpd.conf file), with the following syntax:
# / etc / init.d / httpd restart

then change the hosts file:
# gedit / etc / hosts file inserting in a row for each configured host:
127.0.0.1 127.0.0.1 joomla15ita
sito02

al'uscita and saving. Each host


at this point can be invoked in the browser
with the syntax, eg.
http://joomla15ita


(\u0026lt;- back to all'01 03)



(go to 03 of 03 ->)



0 comments:

Post a Comment