Making your macbook pro or macpro a local webserver for web development

There are instances when having just a local instance available would be perfect. I have looked over the web and found several blogs that show how this is done and I crammed them together to make this document. I was tired of setting up a site on an external web server just to test something small. This is for Mac users, windows user have it pretty easy in this department.

I wanted to have this on my local laptop so that I could edit web templates for customers and upload them to their websites.
Below is one I have started working on for company:

Creating a local Web Server on your mac with High Sierra 10.13.4

Open a terminal window on your mac.
Type the following command, replacing with the user account short name:

sudo nano /etc/apache2/users/USERNAME.conf

Enter the admin password when requested, then paste the following into the nano text editor:

<Directory “/Users/USERNAME/Sites/”>
Options Indexes Multiviews
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
</Directory>

In the .conf file it will look like this:

Edit the Directory path to the appropriate username.
Now hit Control+O to save the changes to , then hit Control+X to quit out of nano
Next, you will start the Apache web server with the following command:
sudo apachectl start

Launch Safari, Chrome, or Firefox and navigate to “http://127.0.0.1” to verify the server is running, you will see an “It Works!” message
Now that you’ve started a successful Apache server in OS X, you can either modify the core ‘localhost’ files, or go further with the user files.

Apache Web Server Documents Location & User Sites Folders

Note, if you just want to use and modify ‘localhost’ root and not the user level Sites at localhost/~user, you can find the apache webserver files and ‘It Works!’ html in the following location:

/Library/WebServer/Documents/

You can now also visit http://127.0.0.1/~USERNAME/ to see the contents of whatever is stored in the directory – if anything is there per user – and you can add an index.html file or whatever else you’d like to the directory to serve it to the outside world or even just your LAN.

Using http://localhost/ is also fine, and by editing the hosts file you can set a local domain to whatever you want to create a local test environment with an otherwise live domain.

This whole process is quite fast, and can be completed in under a minute as demonstrated in the video walk through below:

Shutting Down Apache & Restarting Apache Server
To shut down the web server, go back to the command line and type the following:

                     sudo apachectl stop

If you make changes to the server and just want to restart it, that can be accomplished with the following command instead:

                    sudo apachectl restart

The default Apache server is barebones and does not have PHP, MySQL, or anything particularly fancy enabled. You can either install and configure those manually, or you can go the pre-configured route through an all-in-one server app like MAMP, which includes Apache, MySQL, and PHP in a simple to control app-based web server package. You can get MAMP free from here.

Glad to have been of help to you,
Arthur Poston Jr.

Windows 8 Activation Error: DNS name does not exist Error Code: 0x8007232B

Windows 8 Activation Error: DNS name does not exist Error Code: 0x8007232B

The Windows 8 Activation may fail while using the online activation process. You may receive an error screen similar to this:

Image

This issue was documented in this Microsoft Support article http://support.microsoft.com/kb/929826 for previous versions of Windows but also applies to Windows 8. The cause according to this article is:

As the support article explains, the issue has to do with the default behavior of the activation wizard in certain installation media. Depending on where the installation media was obtained from (for example MSDN or TechNet subscription download) the activation wizard  by default will look for a Key Management Service (KMS) host on your internal network. It will not try to activate using the internet to reach Microsoft Activation servers.

In my case, I downloaded the Windows 8 Pro ISO file from my MSDN subscription. The installation binaries from the MSDN ISO file uses a temporary / default key to install as I was not prompted for an installation key. This installation key is apparently a temporary key that tells the Windows 8 activation wizard to look for a KMS host on the local network only and not try Microsoft’s activation servers online.

The solution is to manually change the product key to a Multiple Activation Key (MAK) most likely provided with your MSDN or TechNet subscription. To change the product key, use the slmgr.vbs script included with your Windows installation. The steps to manually change the product key are as follows:

1. Open an elevated Command Prompt (CMD) in Windows 8. Elevated means, Command Prompt needs to be run as an administrator. To do this, go to Windows 8 Start (click on the Windows key), locate the Command Prompt shortcut on your tiles (or search for it on your Apps) and righ-click on it.

2. The option to Run as Administrator appears on the bottom toolbar as shown in the following screenshot:

3. Once the elevated Command Prompt opens type the following command and press ENTER:slmgr.vbs /ipk “Your 5×5 Product Key”

For example:

4. After you press ENTER you will receive the following confirmation message within 10 seconds:

5. Once you receive this confirmation message you may proceed to activate Windows 8 using Microsoft’s activation servers online.

Upgrading the adsl modem firmware on Cisco 877W router

Upgrading the adsl modem firmware on Cisco 877W router

In order to ensure compatibility and stability with your ISPs equipment in the exchange, it is at times necessary to upgrade the adsl modem firmware on your Cisco router. Download the appropriate firmware for your router (in this case a Cisco 877W). It is essential you get the correct version so take care to make sure you have the correct one. Some older updates can be found here:

ftp://ftp.cisco.com/pub/access/800/

You will need a Cisco Smartnet subscription to get the latest firmware.

Once you have downloaded the firmware (in this case adsl_alc_20190_4.0.018.bin), you need to rename the file to adsl_alc_20190.bin

Telnet into your router and check the current firmware version by running the command:

show dsl interface

From the output of the command you can see under the ‘Operation FW’ section it shows the current firmware file and version, and also that under the ‘FW Source’ it shows the location as embedded.

Next we need to copy the new firmware file to the flash memory on the router using tftp. You can use the Cisco tftp server software to do this. or alternatively download Solarwinds free tftp server software.

Place the firmware file you renamed earlier into the tftp servers root directory and then issue the following command on your router:

copy tftp flash 

fill in the ip address for your tftp server and the source and destination filename adsl_alc_20190.bin

issue the reload command to restart your router:

reload

Once your router is back up telnet into it again and run the following command again to see the result:

show dsl interface

As you can see the ‘Operation FW’ now shows the new firmware version, and the ‘FW Source’ as external. If for any reason you have a problem with the updated firmware, you can easily roll back to the embedded version by deleting the adsl_alc_20190.bin from the routers flash memory.

This can be done by issuing the following command:

delete adsl_alc_20190.bin

When asked to confirm the file deletion just press ‘Enter’