0

I want to work with local web pages using the seleniumIDE

It requires URL's.
So I'd like to set up localhost, 127.0.0.1
I don't need anyone else or network access to it, however it would be ideal if it could still load resources for css, js and their frameworks.

Basically I have a html page I want to see in a browser using a local server

What's the simplest way to get a local web server running so I can do this. I'm on Ubuntu though I imagine the answer could apply to other *nix variations.

I'm more familiar with frameworks like ruby on rails which include a web server I can stop/start but in this case I don't need an application framework, just a basic web server for a html page via a get

  • 1
    What's wrong with just installing one, e.g. apt-get install nginx? For the actual setup read the manual and/or man pages. – Marco Dec 2 '15 at 12:20
  • does your website have any special requirements? e.g. .htaccess type config or URL rewriting? does it need a backend e.g. PHP and a database? if you just need static pages - do as marco suggested apt-get install nginx or apt-get install apache2 - your /etc/hosts file already points localhost to 127.0.0.1 so you can just drop you files into document root, /usr/share/nginx/html for nginx or /var/www/html for apache – the_velour_fog Dec 2 '15 at 14:26
1

Depends on the webserver you're planning to setup.

Could be as simple as: python -m SimpleHTTPServer, or ruby -run -ehttpd . -p8000 or as 'complex' as installing Apache and setting a value in httpd.conf - Listen 127.0.0.1:80.

Here's a big list of oneliners: https://gist.github.com/willurd/5720255

Here's how to make Apache listen to localhost only: https://serverfault.com/questions/276963/make-apache-only-accessible-via-127-0-0-1-is-this-possible

You can check the outcome using something like netstat -an | grep LISTEN

For any other webserver, you're best bet is to look for something along the lines of 'Listen' or 'Interface' in the documentation.

0

adsf—appropriately "A Dead Simple Fileserver"—seems like a great solution to this:

$ gem install adsf
Fetching: adsf-1.2.0.gem (100%)
Successfully installed adsf-1.2.0
Parsing documentation for adsf-1.2.0
Installing ri documentation for adsf-1.2.0
Done installing documentation for adsf after 0 seconds
1 gem installed
$
$ adsf
[2015-12-06 08:24:03] INFO  WEBrick 1.3.1
[2015-12-06 08:24:03] INFO  ruby 2.1.2 (2014-05-08) [x86_64-linux]
[2015-12-06 08:24:03] INFO  WEBrick::HTTPServer#start: pid=811 port=3000

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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