Jump to content

VirtualHost pe un singur ip


alex

Recommended Posts

Putem gazdui mai multe domenii pe serverul nostru, domeniu.com, domeniul.info ...etc. In acest tutorial voi folosi 2 domenii cumparate de la goddady.com :

slashlinux.info

slashlinux-test.info

 

Pasul 1

Configuram urmatoarele fisiere:

# nano /etc/bind/named.conf.local

 

named.conf.local

zone "slashlinux.info" {type master;file "/etc/bind/zones/db.slashlinux.info";};zone "slashlinux-test.info" {type master;file "/etc/bind/zones/db.slashlinux-test.info";};zone "1.192.196.in-addr.arpa" {type master;file "/etc/bind/zones/db.192";};						

 

 

# nano /etc/bind/zones/db.slashlinux-test.info

 

db.slashlinux-test.info

$TTL 86400$ORIGIN info.slashlinux-test  IN	SOA   ns1.slashlinux-test.info. root.test-test.info.(						   2010021700	  ; Serial						   10800		   ; Refresh						   3600			; Retry						   3600000		 ; Expire						   86400   )	   ; Minimum		IN	  NS			  ns1.slashlinux-test.info.		IN	  MX	  10	  mail.slashlinux-test.info.		IN	  MX	  20	  slashlinux-test.info.		IN	  A			   192.168.1.1 # ip ul vostru static/public$ORIGIN slashlinux-test.info.www			 IN	  A	   192.168.1.1mail			IN	  A	   192.168.1.1ns1			 IN	  A	   192.168.1.1root			IN	  A	   192.168.1.1						

 

 

# nano /etc/apache2/httpd.conf

 

httpd.conf

NameVirtualHost *:80<VirtualHost *:80>		ServerAdmin webmaster@localhost		ServerName www.slashlinux.info		ServerAlias slashlinux.info		DocumentRoot /home/dir-slashlinux		<Directory />				Options FollowSymLinks				AllowOverride None		</Directory>		<Directory /home/http-docs/slashlinux				Options Indexes FollowSymLinks MultiViews				AllowOverride None				Order allow,deny				allow from all		</Directory>		ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/		<Directory "/usr/lib/cgi-bin">				AllowOverride None				Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch				Order allow,deny				Allow from all		</Directory>		ErrorLog /var/log/apache2/error.log		# Possible values include: debug, info, notice, warn, error, crit,		# alert, emerg.		LogLevel warn		CustomLog /var/log/apache2/access.log combined	Alias /doc/ "/usr/share/doc/"	<Directory "/usr/share/doc/">		Options Indexes MultiViews FollowSymLinks		AllowOverride None		Order deny,allow		Deny from all		Allow from 127.0.0.0/255.0.0.0 ::1/128	</Directory></VirtualHost>######### New Record DNS - slashlinux-test.info ##########<VirtualHost *:80>		ServerAdmin webmaster@localhost		ServerName www.slashlinux-test.info		ServerAlias slashlinux-test.info		DocumentRoot /home/slashlinux-test</VirtualHost>

 

 

# rndc reload# /etc/init.d/bind9 restart# /etc/init.d/apache2 restart

 

 

Pasul 2

 

Verificam hostingul virtual pentru cele 2 domenii.

Link to comment
Share on other sites

  • 3 weeks later...

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...