Thursday, September 21, 2023
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 16330  / 11 Months ago, sat, november 5, 2022, 12:10:44

I am writing a small website, but I do NOT want to figure out how to install and configure complete LAMP stack to test the website from my ~/home directory. That will be completely disruptive and unnecessary.



All I want is to have a directory, e.g. ~/home/Documents/Website and run a small web server from that folder as the website's "home" folder.



I know Jekyll can do something similar, but it only seems to work with Ruby/Jekyll-based sites that it builds and configures.



Isn't there some small web server program that I can easily install and then just run very simply?



For instance, if I just needed to run something like e.g. simple-server serve ~/home/Documents/Website from a command line and then navigate to e.g. localhost:4000 or whatever to test the site, that would be perfect.



If this is already possible in Ubuntu and I just don't know how, please let me know.


More From » 14.04

 Answers
1

If you have php installed you can use php built-in server to run html/css and/or php files :



cd /path/to/your/app
php -S localhost:8000


As output you'll get :



Listening on localhost:8000
Document root is /path/to/your/app

[#23327] Sunday, November 6, 2022, 11 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oraoming

Total Points: 354
Total Questions: 105
Total Answers: 124

Location: Iraq
Member since Sat, Apr 3, 2021
3 Years ago
oraoming questions
Fri, Aug 20, 21, 10:08, 2 Years ago
Mon, May 24, 21, 21:56, 2 Years ago
Mon, Dec 12, 22, 23:21, 10 Months ago
Mon, Sep 12, 22, 11:38, 1 Year ago
;