Lamp on ubuntu 14.04 .Only want localhost - how? - linux

I want to setup a lamp stack to act as a testing area for my website. I only want it open to my computer on localhost - definitely not the internet. Is there a way to ensure this?
Thanks

Well you don't have to worry too much about this, but there is a solution to be sure that is only localhost.
You need to configure your Apache to listen only to your localhost address and port.
The solution is a bit old, but I don't have Lamp installed on my computer so you have to try it and tell me if it works.
This can be done by editing the file: /etc/apache2/ports.conf
You can do that with this command:
sudo nano /etc/apache2/ports.conf
And replace the Listen 80 to Listen 127.0.0.1:80
Reference

Related

docker-searXNG: I cannot start a tor searXNG instance (Debian)

I am kinda new to docker and as for my first project I wanted to try and start a searXNG instance on tor. There have been many people who have accomplished that, yet I cannot figure out whats wrong.
I've installed tor, searxng-docker and docker-compose on my raspberry pi (it is running raspberry pi os lite), got the .onion hostname and put it in .env and then, I got the instance running. But when I checked the link, it gave me a 404.
Can anyone help? I would really appreciate that.
The output of sudo docker ps:
The .env file (I've hide my email:
Do you want your server to be only available on Tor as a hidden service?
This is not supported out of the box.
Here some information that should help:
Add http:// in front of your server name in .env: SEARXNG_HOSTNAME=http://gpfo...onion
In Caddyfile, add bind 127.0.0.1 just before line 10 (tls {$SEARXNG_TLS}).
In torrc, but sure to have HiddenServicePort 80 127.0.0.1:80 in addition to HiddenServiceDir.

Cannot access eclipse orion server from local machine using local IP

I have been given a centos server to lauch eclipse orion code editor. I installed eclipse orion as per the instruction on https://wiki.eclipse.org/Orion/How_Tos/Install_Orion_on_Localhost (steps for linux using jetty server). It works fine on centos browser. The centos os is running on 198.168.1.226. So that I can access the following urls on web browser of centos.
198.168.1.226:8080
localhost:8080
127.0.0.1:8080
0.0.0.0:8080
But when I tried to access the 198.168.1.226:8080 from other local machines on local network, that is not accessible. I searched the StackOverflow Questions like how to make jetty server accessible from LAN? and Unable to access jetty server with local IP address but both are useless for me. How can I fix this situation? Can I fix it editing the code on orion.ini file or need to deal with configuration file or something else?
I have also tried the orion for windows computer but it worked itself for accessing the orion system for any other computer in local network. But I am surprised to face it on centos using the jetty server for setting up eclipse-orion system .
First of all check that have you allowed specific port (8080) from eclispse.
add rule with that port no. in centos iptables as below:-
iptables -A INPUT -p tcp --dport 8080 (adjust according your port no.) -j ACCEPT

Rename localhost 127.0.0.1, in LAMP stack

I am using a LAMP stack. Will there be problems if I update the /etc/host file to reflect 127.0.0.1 as somename from localhost?
Thanks!
Edit:
I sometimes work in remote sites with no network. I have the same setup on different machines and I need the server name to know dynamically where to do changes, etc.
I edited /etc/hosts to show
127.0.0.1 localhost somename
Now, with my Wifi off I am trying http://somename and it is not connecting. If I turn my wifi on, it works. But I need it to work with no connection. How can I resolve this?
No. Just add somename after localhost separated by space in /etc/hosts. You can add as many aliases as you like, as long as you don't delete localhost.

How to secure memcached on Ubuntu 12.04

Running memcached on Ubuntu 12.04 LTS.
My /etc/memcached.conf file is set to only listen to localhost.
i.e. -l 127.0.0.1
But I can still telnet through to it from the outside even though it is set to only listen to localhost. My site really doesn't host any sensitive data whatsoever but I am a bit stumped that the config file doesn't really seem to do its job. I don't really see the need for IPtables. Any easy fix to secure memcached without having to set up IPtables?
Restart the service, you might have made change without restarting
To make more secure do not use the standard port

webserver node.js as non root user

I'm a Linux beginner and have a Linux Ubuntu 12.04 server. I've installed node.js and created a webserver script. That works fine, but it runs as root user.
I know that's not good (root-user & webserver = unsafe).
How can I run the webserver script as an non-root user? Does somebody know a good detailed tutorial or can give me some advice?
You have two options:
Listen on port 80
Run as root, start your app's listen() on port 80 and them immediately drop to non-root. This is what Apache does, for example. Not recommended since it's easy to get this wrong, and lots of other details (writing to log files, initialization required before you can listen, etc.). Not standard practice in node.
Listen on port >=1024*
Run as non-root, listen on a port >= 1024 (say: 8000, or 8080), and have someone else listen on port 80 and relay port 80 traffic to you. That someone else can be:
A load-balancer, NAT, proxy, etc. (Maybe an EC2 load balancer if you're running on EC2, e.g.)
Another http server, say Apache httpd or ngnix.
For an ngnix example, see this: Node.js + Nginx - What now?
you can just run node hello.js

Resources