3

.I am hosting this website on the RPi 4 - 4GB Ram model.

I'm guessing the google PageSpeed insights ranking score is kinda ok right now (it ranges in the middel with a score of 56) - try and test it yourself if you want too, and see if your get the same score (it's just a temp. landing page with text, no photos and one plugin to Facebook.

But I want more speed, I wanna be able to upload large files to my webpage quickly and I think USB 3.0 + External SSD with Exts4 on it will do the trick nicely.

So:

Thewebpage files + database does not need to MOVED exactly - it's a test-site, and I will gladly delete evrything that has to do with LAMP on the Pi, and start from a fresh all over to install things the right way.

I am LOST in words for what I should search for on Google - I get loads of diffrent results when searching on "hosting usb 3.0 ssd on rpi 4". Here is a picture of ht e test setup, just for fun: enter image description here

So how can Install a LAMP on my external USB disk instead of the 16 GB SD-card wichc is much slow in comparison and make sure everything is set up correctly on not just "works" as good as before..?

NB: I even found a used Dell Server SSD with Random Sector (I think it's called) write speeds of 220 GigaBYTE pr. second... At least that's what crystalDisk/Mark said it had.. Could this be awesome in terms of web page speed?

IT Blacksmith
  • 63
  • 1
  • 8

2 Answers2

3

I want more speed, I wanna be able to upload large files to my webpage quickly and I think USB 3.0 + External SSD with Exts4 on it will do the trick nicely.

Mount your external drive to apache2 web files path. At first, find out what's the name of your drive on /dev:

cat /proc/partitions | grep sd

You might see something like this:

   8        0   30031250 sda
   8        1   30030226 sda1

Which the drive name is sda. So, mount this drive to the web files path:

sudo mount -o defaults /dev/sda /var/www/mysite

Changing permissions of your folder to allow www-data (apache2) to write:

sudo chown -R www-data:www-data /var/www/mysite

In addition, you may reach a better speed if you install the whole apache2 package on your external drive but I'm not sure and have not done something like that.


I even found a used Dell Server SSD with Random Sector (I think it's called) write speeds of 220 GigaBYTE pr. second... At least that's what crystalDisk/Mark said it had.. Could this be awesome in terms of web page speed?

It's not related to "Raspberry Pi" hence please ask these questions in the appropriate SE site.

Mohi Rostami
  • 4,434
  • 1
  • 20
  • 39
2

I found an answer to my own question - it's even official documentation. Right here is a guide of moving all data from SD-card to USB-device and then boot the boot files from SD bot all other files will be run from the SSD USB device.

The link to the guide (work-around): [https://www.raspberrypi.org/forums/viewtopic.php?p=1230182&fbclid=IwAR3idP38EqveSMxbark8R7mqxSEm6u0Js7Ijt1dr0aGBYn1rLK9NkhsTgm8#p1230182][1]

So the real answer is not to run just LAMP on the SSD but the whole Raspian OS :) Thanks to all that helped this far.

IT Blacksmith
  • 63
  • 1
  • 8