Step 1 - Buat nama file dengan nama website anda.
contoh nya saya skrg ingin membuat nama website nescafe.com
pada terminal ssh :
ketik :
sudo bash
lalu kita copy settingan default yang sudah ada menjadi nescafe.com
cp /etc/apache2/sites-available/default /etc/apache2/sites-available/nescafe.com
sekarang kita edit file nescafe.com di dalam folder /etc/apache2/sites-available/
nano /etc/apache2/sites-available/nescafe.com
setelah terbuka,cari baris ‘ServerAdmin webmaster@localhot’
rubah tulisan di atas menjadi email anda
lalu tambahkan :
ServerName nescafe.com
After this, we’ll want to change the document root. Don’t worry if the folder isn’t there yet, we’ll create it in the next step. Change the document root and directory to something similar to how I have below from ‘/var/www’:
Step 2 – Create the document root for your domain or subdomain
Next, we’ll need to create and set the correct permissions to the document root. You can choose whatever path to use, but I’m creating mine inside a directory called vhosts inside the www folder.
If you’ve not already created the ‘vhosts’ directory already, you’ll need to create this first:
mkdir /var/www/vhosts/
After this, create the site’s directory:
mkdir /var/www/vhosts/video.dingleberrypi.com/
If you’ve not already created the ‘vhosts’ directory already, you’ll need to create this first:
mkdir /var/www/vhosts/
Almost there! Now we need to set the permissions so that the system can write, and everyone else can read:
chmod -R 755 /var/www/vhosts/video.dingleberrypi.com
Step 3 – Enable the subdomain or domain and restart Apache2
Next, we’re going to use a built in extension to enable the submain or domain:
a2ensite video.dingleberrypi.com
Now, it’s time to restart apache:
service apache2 restart
There’s one more thing we need to change in those VirtualHost files. We want WordPress to be able to make configuration changes to the folder it’s in (overriding the global defaults for Apache). Do this by editing those files (e.g. sudo nano /etc/apache2/sites-enabled/000-default). Find the section for the /var/www/ directory:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Change AllowOverride None to AllowOverride All, i.e.
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
Tidak ada komentar:
Posting Komentar