"I'm not anti-social; I'm just not user friendly"
All articles
Last comments
Shekin
You can install 370 version also
Vitali80
Thank you so much for your help Shekin, you're great
Shekin
1. sudo xed /etc/apt/sources.list.d/ewscott9-snes9x-trusty.list 2. paste there 2 strings deb http://ppa.launchpad.net/ewscott9/snes9x/ubuntu trusty main deb-src http://ppa.launchpad.net/ewscott9/snes9x/ubuntu trusty main 3. add GPG key.
Vitali80
Sorry for my ignorance but where I can replace "xenial"?
Archive
«    December 2016    »
MonTueWedThuFriSatSun
 1234
567891011
12131415161718
19202122232425
262728293031 
» » LAMP server on Linux Mint - a web site on the local machine

LAMP server on Linux Mint - a web site on the local machine

LAMP serverLAMP server

Many web designers, web masters to create and debug web sites are hosted on a local server (on your computer). When I first installed LAMP server on your Linux mint, I was faced with the inconvenience of the location of the directory sites, by default, all files under the ROOT. Below will tell you how to install a LAMP server and work with your test sites under your username and home directory.



Sorry for the spelling and phonetic errors in the text.
Owner and main writer of MintGuide.org is not a native English speaker.


Open a Terminal (console) and type in there:

sudo apt-get install tasksel
sudo tasksel install lamp-server
do not leave the password blank and will remember!!!
To switch on the OK button press TAB

LAMP server on Linux Mint - a web site on the local machine

LAMP server on Linux Mint - a web site on the local machine

Next 
echo '<?php phpinfo(); ?>' | sudo tee -a /var/www/test.php
sudo gedit /etc/apache2/apache2.conf
In the end of the file add the following line
ServerName localhost
Then restart Apache
sudo apache2ctl restart
will check the performance of your creations writing in the browser: http://127.0.0.1/test.php
 LAMP server on Linux Mint - a web site on the local machine
Now install phpmyadmin
sudo apt-get install phpmyadmin
To select apache2 press SPACE, then TAB
Will check the work phpmyadmin http://localhost/phpmyadmin/

LAMP server on Linux Mint - a web site on the local machine

LAMP server on Linux Mint - a web site on the local machine

Commands management server:
sudo apache2ctl status - the status of the server
sudo apache2ctl stop - stop
sudo apache2ctl start - run
sudo apache2ctl restart - restart
Hosting is ready to work all your files should be placed at /var/www. As you can see, the standard installation, does not take much time.
Now create your host with an arbitrary name, let it be web-site
First, stop the Apache server, and create the root directory for your host. I created the folder web-site in their home directory. (This folder you can create and elsewhere.)
sudo apache2ctl stop
mkdir ~/web-site
Configuration files hosts are stored in the folder /etc/apache2/sites-available. Initially there is file 000-default.conf, this configuration file on localhost. Take it as a basis and copy it to a file named web-site.conf:
cd /etc/apache2/sites-available sudo cp 000-default.conf web-site.conf
Now open the newly created (copied) the file web-site.conf for editing:
sudo gedit web-site.conf
Replaced the original text file with the following: 
<VirtualHost *:80>
 ServerAdmin webmaster@example.com
 ServerName web-site
 ServerAlias web-site
 
 # Indexes + Directory Root.
 DocumentRoot /home/username/web-site
 <Directory /home/username/web-site/> 
 DirectoryIndex index.php
 Options Indexes FollowSymLinks
 AllowOverride All
 Require all granted
 </Directory>
 
 # Logfiles
 ErrorLog /var/log/apache2/mysite-error.log
 CustomLog /var/log/apache2/mysite-access.log common
</VirtualHost>
Instead of the path home/username/web-site will replace username on your user name. If you created a folder for a host not in your home folder, simply enter the full path to this folder. 
Activate the created host command:
sudo a2ensite web-site
It remains to specify matching the IP address of the host name in the file /etc/hosts:
sudo gedit /etc/hosts
Add the line:
127.0.0.2 web-site

An example of my file

127.0.0.1 localhost127.0.1.1 l4l-mate
127.0.0.2 web-site
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Start the server
sudo apache2ctl start
echo '<?php print_r (phpinfo()); ?>' | tee -a /home/USERNAME/web-site/index.php
replace username on your user name and check the operability of the new host is added into the address bar of the browser: http://web-site/ 

LAMP server on Linux Mint - a web site on the local machine

Thus you can create a number of hosts with different names. On one IP you can create multiple hosts with different names, for example:
127.0.0.3 web site2
127.0.0.4 web site3
127.0.0.5 web-site4
and so on.
I will be glad if this article helped You.
Good Luck!!!
Basic information with some changes taken from here

Related articles

Add a comment

  • bowtiesmilelaughingblushsmileyrelaxedsmirk
    heart_eyeskissing_heartkissing_closed_eyesflushedrelievedsatisfiedgrin
    winkstuck_out_tongue_winking_eyestuck_out_tongue_closed_eyesgrinningkissingstuck_out_tonguesleeping
    worriedfrowninganguishedopen_mouthgrimacingconfusedhushed
    expressionlessunamusedsweat_smilesweatdisappointed_relievedwearypensive
    disappointedconfoundedfearfulcold_sweatperseverecrysob
    joyastonishedscreamtired_faceangryragetriumph
    sleepyyummasksunglassesdizzy_faceimpsmiling_imp
    neutral_faceno_mouthinnocent
Login via
Up