How to install LAMP on Linux Mint Cinnamon?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
culinarygods

How to install LAMP on Linux Mint Cinnamon?

Post by culinarygods »

OK below is what I tried and failed.....Can not get to localhost now says Forbidden You don't have permission to access / on this server. Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Uhhhh, this is only my second day with mint and I am getting kinda lost....I see how-to video but a lot of the commands do not seem to work??????
Do I need to reinstall Mint to fix the issues and start over clean?
The reason I am installing LAMP is for a local wordpress site we keep recipes on. Before we had it running in windows10 but we are learning mint as it seems to be well supported and people are very nice in the forum. They seem to know a lot.. It makes it a lot more easy to do things when there is some support for NOBS like me :) We would like to get off windows if we can....We have all working now in 17.2. We can not find any issues yet.....Just the issue I had doing a LAMP install and the commands did not match the How-To any place I looked..... Now I have is so fubar'ed I am locked out of the localhost from firefox.......hahahha

How to install LAMP (Linux, Apache, MySQL, PHP/Perl/Python) on Ubuntu, LinuxMint, ElementaryOS:
1. Open terminal: Ctrl + Shift + T

2. Run this command: sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server-5.6 mysql-client-5.6 php5-curl php5-mcrypt php5-gd phpmyadmin

3. now, open browser and go to link http://localhost

4. Create info.php in /var/www with content ?php phpinfo();
Navigate browser to http://localhost/info.php

5. Config Apache
- Change Document directory to /home/username/www:
- mkdir /home/username/www
- sudo gedit /etc/apache2/apache2.conf
- change Directory /var/www to Directory /home/username/www
- change AllowOverride None to AllowOverride All
- open file /etc/apache2/sites-enabled/000-default.c­onf
- change DocumentRoot /var/www to DocumentRoot /home/username/www
- restart apache: sudo service apache2 restart
- go to /home/username/www and create index.php with content: ?php phpinfo();
- navigate to http://localhost

6. Fix error on restart apache: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
sudo gedit /etc/apache2/apache2.conf
add this line to end of file:
ServerName localhost
restart apache → Done

7. Enable module mcrypt and rewrite
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt && sudo a2enmod rewrite


I also tried this http://connectwww.com/how-to-install-an ... mint/1443/

Thanks to every one who put up with all my questions....I am learning...I promise.....
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mount mint
Level 1
Level 1
Posts: 36
Joined: Sun Jun 14, 2015 11:17 am

Re: How to install LAMP on Linux Mint Cinnamon?

Post by mount mint »

Thanks for posting, this is how I did it : http://forums.linuxmint.com/viewtopic.p ... 3#p1029062
911 WAS AN INSIDE JOB
WharfRat

Re: How to install LAMP on Linux Mint Cinnamon?

Post by WharfRat »

As for your other post, installing LAMP opens a whole new can of worms. You might want to consider iptables netfilter rules runnung apache.

I don't think ufw will provide the level of granularity that would be needed. You might consider getting real familiar with iptables.

As for your problems here, don't specify a version with mysql. Install these:

Code: Select all

sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-curl php5-mcrypt php5-gd phpmyadmin
You're biting off an awful lot for a linux newbie.
culinarygods

Re: How to install LAMP on Linux Mint Cinnamon?

Post by culinarygods »

This is a lan only box......So I hope it is OK....
I have done some tomato and dd-rt stuff before with out much issue and have a sonicwall also.
But it is true in what you say.....It is a very large learning curve for me.....
I think it will be worth it in the long run.....I do like this Mint for sure......Seam's like it is very good distro and people are willing to help us learn.......
When I learn I will show others what I had to do and try to help them when I know a little more.....Also I will post a link to mint on our culinary website because it is the right thing to do....
I will install this now.......I just did a clean install and nothing is loaded but stock 17.2
I will check for updates first....
I will post back in a few minutes when it installs....
Is there a good how-to yet for lamp on 17.1 or 17.2 or was the install above correct?
Again, Thank you for being so nice to me on my first few days.....
Todd
culinarygods

Re: How to install LAMP on Linux Mint Cinnamon?

Post by culinarygods »

WarfRat, worked perfect! I made a file from root and posted it in var/www/html/phpinfo.php and added this line to it <?php
phpinfo();
I can access it by http://localhost/phpinfo.php I set permissions to Owner =R/W Group=root R and access as none (not sure if none is correct)
I can access http://localhost/phpmyadmin/ seems to be working correct?
Also did a update again and saw a lot of new updates....Took all updates...

But I am still seeing this?

Code: Select all

sudo /etc/init.d/apache2 restart * Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
We do not have a domain controller set up as we do not run a server yet...Just a workgroup set up....

Now on to the wordpress part?

Hmmmm, no Ipconfig in linux?
WharfRat

Re: How to install LAMP on Linux Mint Cinnamon?

Post by WharfRat »

culinarygods wrote:This is a lan only box......So I hope it is OK....
If you don't forward your router ports then you'll be fine.
culinarygods wrote:Hmmmm, no Ipconfig in linux?

Code: Select all

ifconfig
culinarygods wrote:But I am still seeing this?

sudo /etc/init.d/apache2 restart * Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
I haven't fooled with a LAMP in a long time so I really have no clue :?
culinarygods

Re: How to install LAMP on Linux Mint Cinnamon?

Post by culinarygods »

PHP gave a error in mcrypt at the bottom of the phpmyadmin!
The fix is below

Code: Select all

sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart
Also did a virtual host by doing this.
sudo nano /etc/apache2/sites-available/wordpress.conf
<VirtualHost *:80>
ServerName xxxxx.xx
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite wordpress.conf
sudo service apache2 restart

ServerName FQDN was a issue so I added this to the very last line on the conf file "ServerName xxxxxx.xxx"
sudo nano /etc/apache2/apache2.conf
sudo service apache2 restart

Tested in firefox xxxx.xx and got the It works default page!
If this looks OK let me know.....As you all know it is only my 2nd day using Linux and Mint :mrgreen: But, if you never try how will you know if you could do it............
WarfRat, could not have done it with out you! Thanks
culinarygods

Re: How to install LAMP on Linux Mint Cinnamon?

Post by culinarygods »

OK, kinda got wordpress installed but when I try to update the theme I get The uploaded file exceeds the upload_max_filesize directive in php.ini. But I do not see a php.ini file????
Where is the php.ini file for this install of wordpress? Not like my other servers?????
hmmmmm, also when I try to update any plug-in I get this To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.
Why does it ask me for FTP when I am local and in root?

Fixed the ftp by adding define('FS_METHOD', 'direct'); to wp-config.php but something is still wrong?

Downloading install package from https://downloads.wordpress.org/plugin/ ... .4.2.1.zip

Unpacking the package…

Could not create directory.
Ginsu543

Re: How to install LAMP on Linux Mint Cinnamon?

Post by Ginsu543 »

I've never installed Wordpress, so I'm not exactly sure, but have you checked under /etc/php5/apache2 to look for your php.ini file?
culinarygods

Re: How to install LAMP on Linux Mint Cinnamon?

Post by culinarygods »

I can not seem to make any of the word press work correct. I do not think permissions are correct by default????
$ ps aux | grep apache
root 2151 0.0 0.1 375736 28504 ? Ss Jun25 0:04 /usr/sbin/apache2 -k start
www-data 2231 0.0 0.3 385740 50692 ? S Jun25 0:04 /usr/sbin/apache2 -k start
www-data 2232 0.0 0.2 380292 41196 ? S Jun25 0:04 /usr/sbin/apache2 -k start
www-data 2233 0.0 0.2 380268 40516 ? S Jun25 0:04 /usr/sbin/apache2 -k start
www-data 2234 0.0 0.2 385184 48184 ? S Jun25 0:04 /usr/sbin/apache2 -k start
www-data 2235 0.0 0.2 380504 40432 ? S Jun25 0:04 /usr/sbin/apache2 -k start
www-data 2242 0.0 0.2 380248 39872 ? S Jun25 0:04 /usr/sbin/apache2 -k start
www-data 2243 0.0 0.2 380248 40052 ? S Jun25 0:04 /usr/sbin/apache2 -k start
www-data 2244 0.0 0.2 385172 47684 ? S Jun25 0:04 /usr/sbin/apache2 -k start
todd 20365 0.0 0.0 11752 2208 pts/0 S+ 16:02 0:00 grep --colour=auto apache

How do I do this to make it work?
For this first method, we’re going to find out which user owns the web server and give that user ownership of your WordPress installation.

We’re assuming you’ve got a Linux box running Apache as the web server as that’s the most popular hosting plan type.

Login to your server box using ssh.

Find out what user is running the web server by typing:
ps aux | grep ‘apache’ The command will return something similar to this:
root@ubuntu-box:/# ps aux | grep ‘apache’
root 1933 0.0 2.3 44900 12032 ? Ss Aug25 15:09 /usr/sbin/apache2 -k start
webuser 2572 0.0 6.2 66468 30246 ? S Mar10 0:04 /usr/sbin/apache2 -k start
webuser 6045 0.0 6.4 66884 31562 ? S Mar10 0:07 /usr/sbin/apache2 -k start
webuser 6786 0.0 5.6 64156 27632 ? S Mar10 0:10 /usr/sbin/apache2 -k start
This tells you that the web server is running under the user webuser.

You can now give that user recursive ownership (all subfolders) of your WordPress installation using the command:
chown -hR webuser:webuser /var/mydomain.com/public_html/wordpress/ Replacing webuser with whatever user is running your Apache server and the last part with the direct path to your root WordPress installation folder.

Note: Some chown versions are different. Type chown –help to get info on your version.
Uhhhh, Not sure how to make it work correct.....I am sure it is OK, just the default is not set correct?????
Any Ideas..........
2 days on Linux now????? WOW, lot to keep learning....
mount mint
Level 1
Level 1
Posts: 36
Joined: Sun Jun 14, 2015 11:17 am

Re: How to install LAMP on Linux Mint Cinnamon?

Post by mount mint »

911 WAS AN INSIDE JOB
culinarygods

Re: How to install LAMP on Linux Mint Cinnamon?

Post by culinarygods »

Hi, Mount Mint :)
Do you think this is a good fix for the issue???? I might try a clean install and work through it again to see if I missed some info or some setup issue with my very very fat 4 days on Linux fingers? Hmmmmm that post was from 2012...You would think by now it would be fixed in Apache....lol

$ cd /<wherever>/Sites/<thesite>
$ sudo chown -R _www wordpress
$ sudo chmod -R g+w wordpress

This way, the WordPress directories have a permission level of 775 and files have a permission level of 664. No file nor directory is world-writeable.
User avatar
Spearmint2
Level 16
Level 16
Posts: 6900
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: How to install LAMP on Linux Mint Cinnamon?

Post by Spearmint2 »

All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
Locked

Return to “Beginner Questions”