By kamauhillux
How do I configure apache2 web server on my Ubuntu,so that I can run my html scripts?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The best way is to create a digitalocean LAMP droplet, it has everything preconfigured. All you’d have to do, at a minimum, is drop your PHP scripts into /var/www and it should be able to serve those scripts. If you wanted to write to that folder using PHP (for example, file uploads or image manipulation), I’d create a subfolder under that and change the ownership to www-data.
If you have a droplet (or any linux machine) but don’t have apache, MySQL and php installed, it’s not too hard to install it. Here’s a tutorial that should give you the basics.
http://www.linux.com/learn/tutorials/288158-easy-lamp-server-installation
In case you’re going with a manual LAMP install: [Link]
Then I advise to secure your server by enabling the firewall and installing Fail2Ban. It’s not a bad idea to change the default SSH port to something else, because you’ll already see a lot of brute force attempts few hours after setting up the droplet.
Additional steps: [Link] Fail2Ban: [Link]
If you don’t intend to fiddle with your droplet after setting it up it’s also a nice idea to enable automatic security updates: [Link] (scroll to the bottom of the post)
P.s.: My only issue with Fail2Ban is that it stopped working after the logs rotated—happens every week by default, I think. I may have managed to fix it in my droplet, but I’m not entirely sure yet. Meanwhile keep an eye on your logs to make sure it works.
Heya,
The best option now would be to use the MarketPlace Droplet, it comes with pre-configured LAMP stack for you:
https://marketplace.digitalocean.com/apps/lamp
And if you want to install it manually, you can use the following tutorial:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.