In a recent pursuit to have the fastest speeds possible at home, I have started to upgrade and replace a large section of my home network.
Ensuring That My Network Runs Fast at its Core
Barring the routing technologies at home the most crucial part of my network is my server, an old Dell Optiplex 780 salvaged from an office clear-out it now spends its days hosting my media, files and applications. One of the first things I did was replace all of the cabling around my network. Most being CAT5 the fastest speeds possible were only 100Mbps, this was a noticeable bottleneck when I checked iPerf3 as the switch its connected to, the router and my PC were all gigabit connected and clearly an oversight on my part. Replacing the cable from it to the switch instantly jumped the speed to gigabit. Yay!
Getting Rid of Old Hardware
Another decision I made was to remove some of my old hardware that was no longer up to the task of Gigabit+ speed. That for me meant swapping out a dumb switch capable of 100Mbps max for a new 8 port gigabit one, oddly I bought the 100Mbps one for £10 and sold it for £14 on Ebay so I guess theres money in old switches.
I then replaced its cables too and viola, 1 Gbps throughput on the whole wired network!
What does the future hold?
After looking at transfer speeds between my server and PC, I think the next step is to replace the Optiplex and my PC, as they are now at the point where their age is starting to be a performance problem, although they remain somewhat performant at their daily duties they are both starting to age poorly with the increasing demand from myself for hosting my projects.
I also want to try SFTP+ but I don’t yet have the SSDs or Hard-drives to necessitate it.
Ok, So you want to start a minecraft server. Well theres some stuff you need to do first to let your friends connect, if you want to run a minecraft server for just you and the people on your WiFi/house, then this tutorial isn’t for you. Secondly this tutorial will not require Hamachi.
What you need to do
Firstly, you will need a minecraft server, either bukkit or vanilla, I will be using vanilla, but you can use any minecraft server so long as it works. (first make sure that you follow any instructions that any non-vanilla installations tell you, this is most important. this includes how to make a run file)
Firstly you need to have already done these things.
Created a run.bat file or run.sh file (not needed for forge or vanilla)
Tested that you can connect to your server on your own computer ( you can do this by connecting to ‘localhost’ on your own computer, please note that trying this on any other computer will not work)
Have your router admin and password ready.
Have access to the internet. (please note this tutorial will likely not work in an office or building with multiple vlan’s and networks. ignore this if you are unsure
Now that you have those things we need to make sure everything is 100% ready, so lets start.
Getting a Minecraft server and connecting to it on your computer
Before we try to let friends connect we better check that we can.
First, start your minecraft server, if you don’t have one, you can download it here or if you are not on windows or aren’t sure, download it here. if you are not using minecraft_server.exe then you will need to make a run.bat file you can do this by making a text file called run and then saving it as run.bat with the contents below. put these in your downloads folder in a folder called minecraft server.
java -Xmx1024M -Xms1024M -jar minecraft_server.jar
Now you have that, lets make sure we can connect on our own computer. (if you are trying to connect on another computer, this step will not work)
Start the minecraft server, it should look like this (if you are not seeing this, or it opens then suddenly closes, read the troubleshooting section!!! it is likely because you have not accepted the eula, change the word ‘false’ to ‘true’ in your file called eula.txt)or thisif your server does not look like this, then check the troubleshooting section at the bottom of the page
DO not skip the above section, your server WILL not work without these steps
Now we need to connect to our server. Connect to ‘localhost’ in your minecraft game.and when you connect you should see this. and this congratulations, you have successfully connected to your own minecraft server.
Now you have done this you can move onto the next step to allow your friends to connect, if you couldn’t connect, something is wrong, check the troubleshooting section.
Who am I?
Now that you have setup your minecraft server, you need to let others connect, before you can do this you need to do a few things. Firstly you need to click this link, this will tell you your WAN IP, which you will need later. write this down or leave the tab open, it should look like this,
keep those numbers, you will need them later (YOURS WILL be different to the one in the tutorial)
you also need your LAN IP.
On your keyboard press the WIN + R keys at the same time.
in the box type ‘cmd’
you should have seen theseafter you have the black box, you don’t need the white one, it should close automatically when you click ok.
Now type ‘ipconfig’ and press enter, you are looking for one with the words default gateway, but you will also need IPV4 address. you now know your default gateway and LAN IP.
After this tutorial, you should have exactly 3 numbers, all of witch you WILL need.
your LAN IP, your WAN IP and your default gateway.
they should look something like this, but may also be vary different
LAN IP : 192.168.1.3
WAN IP : 18.104.22.168
DEFAULT GATEWAY : 192.168.1.1
You need these three numbers, without them you cannot continue.
Letting friends join! (Port forwarding)
Now that we have the numbers from the previous step, lets put them to good use, open your web-browser and type in the numbers in the address bar, (do not Google the numbers, that’s not what you want silly).
now you need to login, if you dont know your login, you need to Google your make and model of your router for the default passoword, if that didn’t work, it may be that someone else changed it, ask someone in your household who set it up or check the troubleshooting section.
Once you have logged in, go to the port forwarding section on your router, if you cannot find it then google the make and model of your router followed by how to port forward. Once you have reached the port forwarding section, add your minecraft server by entering the following
Service Port (sometimes just called port) : 25565
IP Address (THIS IS WHERE YOU ENTER YOUR LAN IP, that we got earlier, my'n is this) : 192.168.1.3
*Internal Port (optional, may also not exist) : 25565
Protocol : ALL (or in my case TCP and UDP)
Status : Enable
then you can check that your port forwarding has worked by going here and typing 25565 as the port number (make sure your server is running or this test wont work).
you should see
Success: I can see your service on 22.214.171.124 on port (25565) Your ISP is not blocking port 25565
Congratulations, you have successfully configured and allowed your minecraft server to be used over WAN, your friends can now connect to your minecraft server using your WAN ip, which in my case is ‘126.96.36.199’.
While you are still logged into your router, it is a good idea to statically assigning your computer’s IP address to prevent it from breaking, you can do this by going to the address reservation tab in your DHCP settings and adding your computers LAN ip to the list and selecting your computer from the connected clients.
TroubleShooting / OOPS, it broke
It says ‘java.net.ConnectException: timed out: no further information:’
Ok, it looks like you cannot connect you your server, here are some possible solutions
Make sure your minecraft server is running. Try again if not
Try connecting to ‘localhost’ on the machine the server is running on, did it work, if it did make sure your port forwarded correctly, see if your LAN ip has changed. see if your WAN ip has changed, this may be because you have restarted your router or computer, in which case you will need to statically assign your IP addresses to prevent this.
I don’t see the boxes in the who am I section.
Ok, it looks like your run file is not working correctly, try double clicking the jar file, did that work? if not you may need to re download it.
It says Failed to bind port!
Ok, it looks like youve opened your server more than once, even though you may only see one server running, double clicking the file can also run the server, if you know how to go into task manager and end the task, or if you dont, restart your pc. If none of those work, you may have something already using the port your trying to connect to.
How do I op myself.
Simple, click on the server box and type, you can use commands in there.
it says ‘Error: I could not see your service on 188.8.131.52 on port (25565)’
(the IP may be different) It looks like you have not configured port forwarding correctly, or your minecraft server is not running, you computer may also be blocking the port, google how to allow a mincraft server through a firewall. you may also be running on a different port, look in your server for the line Starting minecraft server on *:25565, is this correct? make sure that your port numbers are accurate.
I don’t know my router login is it the same as my WiFi password?
No, but try it anyway.
I don’t know my router login
It’s usually unchanged form the default. Look at the router, is the login information on the box? Sometimes it is a random set of letters and numbers look on the router it’s self for information. Ask family if they know or consult your ISP for help. It may also be ‘admin’ ‘admin’ or ‘admin’ ‘password’ for the login username and password. Google the make and model of your router for help. If you still cannot find it ask someone else to do it for you. Do not reset the router if you don’t know how to set it back.
It says Error: unable to access jarfile!
It looks like your runfile is not configured correctly, the name of the file should be exactly the same as the name of the server.jar file. so if your file is called ‘minecraft_server1.7.10.jar’ then your run file should be ‘java -Xms2024M -Xmx2048M -jar minecraft_server.1.7.10.jar nogui’
The server does not run!
There may be a file called eula.txt, change the word ‘false’ to ‘true’. this is because minecraft has changed their eula.
My server has lots of errors!
Yep, because bukkit was taken there are some now, also when starting for the first time it may have to create some files necessary to start that can cause errors, just restart and you should be good to go.
Recently bukkit has been issued a DMCA takedown because of recent events and the massage below appeared on bukkit’s downloads pages.
451 Unavailable for Legal Reasons. This content is unavailable as the direct result of a DMCA takedown request. A copy of the notification can be found at this link.
What now? well, we don’t know, as far as we are aware Wesley Wolfie is issuing the DMCA notice to Multiplay (who host bukkit and bukkit’s download links (reference)).
I believe that Spigot will continue to update there builds but are in the same boat as bukkit, but that it is ok for them to do so as it is not Wolfie’s Intention to stop the modding of bukkit but to protect mojang from using his code in their develpments of bukkit as he was unaware that mojang had aqquired bukkit and he was no longer working for an open source project and was now working for mojang essentially for free.
Hashing a password means that users cannot have their passwords compromised when a database engineer is reading cleartext in user databases (to a degree, the passwords could be decoded, but hashing them makes them illegible to someone who is not doing anything extensive). And also prevents hackers from reading passwords in plain text and can be compromised by collision attacks.
Additionally when hashing a password a salt may be added to the password, this prevents a database from being attacked by dictionary attacks.
Why Hash Passwords?
Storing User credentials in Plain Text is generally as bad practice as it allows anyone who reads the file (or computer) to see the password, username or any other credential without any sort of protection, In some cases it is against the law, such as PCI SSC Data Security Standards which handles debit and other card types. The solution to this is to Obfuscation in the form of hashing. Hashing a password makes a standard password seem completely random.
How hashing works
When a user signs up for a website or any other form that requires secure credentials, such as a password, username, email address or address, that user will fill in a form that will ask these credentials, then the web server will both hash and store the hash, the server will ‘throw away’ the original password and keep the hash. In a more secure environment the user may also be given a salt, this may be unique to the user or unique to the application (The user will not know the salt, the salt is owned by the server and will be kept secret.). When hashing both the password and salt will be combined and hashed.
I recently installed php, but when I was unable to save files, I was very stuck, and that’s why I’m posting it here, I want to tell anyone who Googles this problem to find this solution.
The problem was when I used an fopen and fsave within php, the file would always ‘die’ as in the open or die within php. The solution is below
Firstly I looked for the Environment user in phpinfo() in my case it was [box type=”shadow”]www-data[/box] and then I simply typed this [box type=”shadow”]chmod 777 -R www-data /var/www[/box] that, in its simplicity is the solution, but I am thankful that I have found the solution!
To create a phpinfo you need to create a file in your root and insert the following code
and save it as phpinfo.php or whatever you choose, I saved it in my root but you can save it wherever you want, then I browsed to the environments section and that gave me the necessary information for me to create the solution.
Why this works
The problem was that php did not have enough permissions to write to the folder. by giving the user www-data full permission i.e. 777 it can now read write and execute without a problem!
GoDaddy is a great Domain Registrar, I have GoDaddy as my Domain Registrar.
When using domains and Subdomains you may want to have multiple websites on the same server, here is how to add hosts to your GoDaddy account.
First Browse to Godaddy and Login, It may be slightly different for you as I live in the UK.
First Click on My Account, then Visit My Account… You should see this page, Expand Domains.
On the domain you would like to Add a Host to, Click Launch. You should See this Page….
Please note some of my sensitive information has been removed…
To add a subdomain Click Host Names (Manage) In there click Add Hostname. The Hostname will be the Subdomain Name, The IP address will be the IP address of the web server(Or Application Server). Then Click Add.
Please note that it can take up to 48 Hours for a DNS Host to update through the Internet.
To Set the Domain Record, Click DNS Zone File,Click Add Record, Select A (Host), Enter the Host that will be the Domain or Subdomain, such as www (By Default this is already configured, so click edit rather than add record.) Then Click Points to, The IP address will be the IP address of the web server(Or Application Server), Then set The Time To Live (TTL), If you are unsure what to do, leave it as default. Then Click Add.
Please note that it can take up to 48 Hours for a DNS Host to update through the Internet.
I recently played around with Apache and fond it incredibly educational.
I used Apache for multiple websites and sub-domains, and its a great web server. and I like Xampp’s user Interface, allowing me to edit, configure and Error check my site.
Don’t get me wrong though, there are some downfalls when putting it through its paces using Owncloud I discovered that php supported was only allowing 2GB uploads, because it is 32Bit, I later discovered that Xampp is only 32Bit for Windows. This was a major disappointment for me, but I still found workarounds.
Apache is great and easy to use with Xampp, I recommend that anyone wanting to get into web servers and general Web hosting try it out first. I hosted it on my Windows Server, But using a server is completely unnecessary, I was also able to run it on my Laptop.
For a test Environment or to start out on Web Servers, I recommend Xampp. Its a trade up over usability and performance on Windows.