homerguy
Posts: 22
Joined: Mon Aug 13, 2012 8:39 pm

Raspberry Pi LAMP server

Fri Aug 24, 2012 3:34 pm

Hello,

I know pretty much how to setup a LAMP server for the pi, my question however is, how would I set up my web server onto a usb flash drive which I have mounted? I don't want any of the web server contents/activity to be on the SD card

homerguy
Posts: 22
Joined: Mon Aug 13, 2012 8:39 pm

Re: Raspberry Pi LAMP server

Fri Aug 24, 2012 3:49 pm

Doing some research,

Would XAMPP Lite be a viable candidate for this project?

homerguy
Posts: 22
Joined: Mon Aug 13, 2012 8:39 pm

Re: Raspberry Pi LAMP server

Fri Aug 24, 2012 3:51 pm

homerguy wrote:Doing some research,

Would XAMPP Lite be a viable candidate for this project?
Or sorry, regular xampp, lite seems to be windows only?

ghellquist
Posts: 69
Joined: Thu Aug 02, 2012 8:47 am
Location: Stockholm Sweden

Re: Raspberry Pi LAMP server

Fri Aug 24, 2012 4:10 pm

There are a few references in the setup files you need to change.
Apache2
Not an expert, but this works for me (my site is on /opt2 disk and you need to create a few directories there

/etc/apache2/sites-available
...
DocumentRoot /opt2/www
...
ErrorLog /opt2/apache2/error.log
CustomLog /opt2/apache2/access.log

Mysql
/etc/mysql/my.cnf
datadir = /opt2/mysql

Possibly there are more adresses to change, not certain.


// Gunnar

homerguy
Posts: 22
Joined: Mon Aug 13, 2012 8:39 pm

Re: Raspberry Pi LAMP server

Fri Aug 24, 2012 4:28 pm

Interesting,

Is there something to be changed in PHP?

User avatar
MrBunsy
Posts: 185
Joined: Mon Feb 20, 2012 1:48 pm
Location: Southampton, UK
Contact: Website

Re: Raspberry Pi LAMP server

Fri Aug 24, 2012 5:07 pm

All the PHP scripts you want to be hosted by apache will have to be in apache's documentRoot, and whatever files those scripts access is up to whatever the script does.

ghellquist
Posts: 69
Joined: Thu Aug 02, 2012 8:47 am
Location: Stockholm Sweden

Re: Raspberry Pi LAMP server

Fri Aug 24, 2012 9:09 pm

homerguy wrote:Interesting,
Is there something to be changed in PHP?
Not that I know of. The scripts are "in the web-site" and hence follows the apache2 document root, and AFAIK there are no parameters in the PHP system that needs to be changed.

Additionally I recommend downloading php-apc. Default config works for me. It makes php scripts run much faster. If you are planning on getting wordpress installed (I have on my Pi), get the wp-super-cache plugin as well, simply enable it without any fancy settings and that will help as well.

If even more performance is wanted, I believe there are solutions where nginx (alternative to apache or lightpd) will be a better solution. That one seems a bit more difficult to get up and running though.

// Gunnar

User avatar
MrBunsy
Posts: 185
Joined: Mon Feb 20, 2012 1:48 pm
Location: Southampton, UK
Contact: Website

Re: Raspberry Pi LAMP server

Sat Aug 25, 2012 9:19 am

nginx was pretty easy to get up and running for just a bog-standard website, if you want virtual hosting (multiple domains/subdomains from same IP) or any URL-rewriting, it was a little fiddly. Not much more than Apache was, but with fewer examples on the web to copy.

Return to “General discussion”