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?

1
  • Should I move this to another Stackoverflow board about linux in general or...? Commented Feb 7, 2020 at 11:19

2 Answers 2

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.

8
  • Thank you! Is it really that easy to do? Wow! I will set this up and try it in a matter of minutes, at most 1 hour, and then get back to you with some results. And I don't even have to reinstall LAMP... :D Or set it up diferently either or am I wrong? Commented Feb 7, 2020 at 11:27
  • 1
    @ITBlacksmith No, you don't need to reinstall packages but I added a new part to the answer "In addition, ...". Alright, good luck. Commented Feb 7, 2020 at 11:32
  • YE, I just saw that. I might wanna google how to solve that first or after I move the server files to the exSSD? Commented Feb 7, 2020 at 11:33
  • @ITBlacksmith Yes, it's not complicated. Did you accomplish this project? Commented Feb 8, 2020 at 10:42
  • 1
    You can run sudo umount /dev/sda. You need to add your files to /var/www/. I mean, /var/www/ => https://vuh.dk/ AND /var/www/mysite => https://vuh.dk/mysite to figure it out. Commented Feb 8, 2020 at 14:27
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.