Virtual host on linux mint 18 using XAMPP for Linux 7.0.8-0

bawa_d
  7 years ago
  0

if you want to install xampp goto following link:

https://community.linuxmint.com/tutorial/view/1016

 

hello friends,

I am going to create a virtual host on linux mint 18 cinnamon 32 bit using XAMPP for Linux 7.0.8-0.

My virtual host would be following:

test.local

Default: Xampp is installed in /opt/lampp/

Project root directory: /home/deepak/test/

or inshort create the directory (test) inside your user's home directory.

Note: Below would be implemented successfully only if all the things implemented using root access.

Step-1:

goto /opt/lampp/etc and open the httpd.conf file with root access.

Step-2:

search for below mentioned text in above said file. It should be at 487 line number.

Virtual hosts

Step-3:

At below above said line there would be a text something like below

# Virtual hosts
# Include etc/extra/httpd-vhosts.conf

if # sign would be at front of Include then remove that #.

Step-4:

Save the above said file.

Step-5:

goto /opt/lampp/etc/extra and open the httpd-vhosts.conf file

Step-6:

Search for ServerAdmin test.local and Copy the code from below link.

Click Here for virtual-host-in-ubuntu-linux-mint-using-xampp/

Step-7:

goto /etc and open hosts file.

Step-8:

copy and paste the following in above said file:

127.0.0.1    test.local

Step-9:

Restart xampp using below command:

sudo /opt/lampp/lampp restart

step-10:

now create a php file named index.php and put following in the /home/deepak/test/ or your path for test directory:

<!--?php

echo "Hello World!";

?>

step-11:

now give permissions to the directory using following command (replace deepak with your user name):

sudo chmod -R 777 /home/deepak/test

Step-12:

now open your browser and put test.local in the url and hit enter. If all goes right you would see Hello World!

 

Thank you for you time.

That's all. Thanx.

DONE!!!

Comments
bawa_d 7 years ago

thanx for your feedback hammer459.

below is gift for new bees.

chmod a-w file (removes all writing permissions)
chmod o+x file (sets execute permissions for other (public permissions))
chmod u=rx file (Give the owner rx permissions, not w)
chmod go-rwx file (Deny rwx permission for group, others)
chmod g+w file (Give write permission to the group)
chmod a+x file1 file2 (Give execute permission to everybody)
chmod g+rx,o+x file (OK to combine like this with a comma)

u = user that owns the file
g = group that owns the file
o = other (everyone else)
a = all (everybody)

r = read aces to the file
w = write access
x = execute (run) access

http://linuxcommand.org/lts0070.php


Hammer459 7 years ago

Thou shalt never use the numbering when changing permissions on a file, especially when doing it as root. It will work properly 99.99% of the times. But if a file has one or more "sticky bits" set in the permissions the file is from that instant effectively broken. Doing this in a recursive manner makes it even worse.
The proper way would be;
sudo chmod a+rwx /home/xxx/test
The file you just added should not need to have x-bit set and thus already have good enough permissions. If not do the same for any .php file;
chmod a+x *.php as you did this as yourself sudo is not needed :-)

Other than that... Seems good to me