How to access Ubuntu Server from local PC?
Today I installed my first web server, which is Ubuntu 12.04 LTS.
I got Apache, PHP and MySql working, there is even MyPHPAdmin! Everything is working fine on that PC, but the problem is that I have no idea how to connect to this server from my PC.
Just to clarify- I got one PC that I work on and got another one, which has Ubuntu Server running. I even managed to connect them through the router, which I made to work as a switch. I can see the Ubuntu Server on my Windows PC in "Network", but it's empty, I can't see any files.
I tried to share a folder etc/www on Server, but it shows an error saying something about right, that I'm not this folder's owner. I guess I'm not doing the right thing at all, am I? Even if I could see shared folder on my Windows PC- I would still be not able to type "somedomain.com" on Windows PC and access for example index.php or MySql database.
So, the question is- how do I configure Ubuntu Server to be accessible from Windows PC?
Ensure you have OpenSSH installed on your server, you can install it with sudo apt-get install openssh-server
. For future installations, you get a menu during installation of the server with different choices. Lamp, openssh, MySQL etc. If you mark openssh you're good to go after installation.
Furthermore, if the computer you want to access from runs windows, download a program called putty.
If it runs any distro of linux you can use the terminal. sudo apt-get install openssh-client
. The syntax for accessing the server from your terminal is like this ssh my-user-name@my-server-ip
. If you have a domain associated with the IP you can replace the IP with the domain.
Hope this helps
First of all ensure that Apache is running. To make sure, type ps -A | grep 'httpd'
Any output is good, nothing means it isn't running.
After you have made sure that Apache is running, you have to take note of the server's IP address inside your network. If your server is connected to the network via a wired connection ifconfig eth0
and search for inetaddress. Note it down.
Picture of the above (I am demonstrating my wireless connection, because I am on a notebook and the wireless interface is assigned an IP address, but it should be the same for a wired connection, only the interface should be eth0 or eth1, depending on how many wired network interfaces your computer has):
NOTE: Make sure you are checking a wired interface if your computer uses a wired connection, or a wireless if it is wirelessly connected. ifconfig -eth0
is good to check the wired connectivity, ifconfig -wlan0
is the wireless one. If none of the above are producing output, check ifconfig
Then just open a web browser, example: Chrome and type in the address bar the server's ip address followed by the port your apache server is running (default: port 80)
Example:
If you have set up everything properly, while doing the above, your server should respond like this, provided that you have not configured apache to serve a webpage, by storing its files in /var/www.