You are reading the article How To Setup A Web Server In Mac Os X Mountain Lion updated in December 2023 on the website Kientrucdochoi.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested January 2024 How To Setup A Web Server In Mac Os X Mountain Lion
In the recent version of Mac OS X, the web server is one of the component that is built-in by default. Prior to Mountain Lion, users can easily turn on the web server via the “Web Sharing” option in the Sharing Preference pane. That component was removed in Mountain Lion. In this tutorial, we will show you how to activate the web server in Mountain Lion, as well as setting up PHP, MySQL and PhpMyAdmin. At the end of this tutorial, you will have a MAMP (Mac, Apache, MySQL, Php) server running on your Mac.
Starting the Apache serverApache server is pre-installed in Mac OS X, so there is no need to install it. However, to start the Apache server, we will have to use command line in the Terminal.
2. Type the following command:
To restart the Apache server, use the command:
sudo
apachectl restart
To stop the Apache server, use the command:
sudo
apachectl stop
Activating the PHP moduleThe Apache server is only good enough for you to run static HTML files. If you want to run a more complicated setup, like installing WordPress, you will need to activate the PHP module.
PHP is pre-installed in Mac OS X as well, but it is not included by default.
1. In the terminal, type:
2. Remove down the list until you see the line:
#
LoadModule php5_module libexec/
apache2/
libphp5.soRemove the “#” in front of the line, so it becomes:
3. Save the changes (using shortcut key “Ctrl + o”) and exit (using shortcut key “Ctrl + x”). Restart Apache.
sudo
apachectl restart
The PHP module is now activated.
Configuring Sites folder1. Open the Finder and go to your Home folder (the folder with a Home icon and your username). Create a new folder “Sites” if it is not available.
2. Back to the Terminal, type the command:
sudo
nano
/
etc/
apache2/
users/
username.confReplace the “username” with your login username. In my case, it will be “sudo nano /etc/apache2/users/damienoh.conf“.
3. Copy and paste the following code to the conf file.
Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all
4. Next, type the command:
nano
/
Users/
username/
Sites/
phpinfo.phpand paste the line:
Restart Apache server
Setting up MySQLMySQL is not included in Mountain Lion, so you will need to download and install it manually.
1. Go to MySQL Download site and download the MySQL installer for Mac. For easier installation, you might want to grab the .DMG image than the one in chúng tôi format.
2. Once the download is completed, open up the installer, you should see two .pkg files and one .prefPane file. Install all three of them.
Setting upi MySQL root passwordIn the Terminal, type the command:
/
usr/
local/
mysql/
bin/
mysqladmin-u
root password'yourpasswordhere'
Replace the “yourpasswordhere” with your own password.
Note: Do not confuse this password with your Mac login account. They are not the same. This is the password for the script to access your database.
Note: Removing MySQL is not as straightforward. Run the commands, line by line, in the terminal:
sudo
rm
/
usr/
local/
mysqlsudo
rm
-rf
/
usr/
local/
mysql*
sudo
rm
-rf
/
Library/
StartupItems/
MySQLCOMsudo
rm
-rf
/
Library/
PreferencePanes/
My*
rm
-rf
~/
Library/
PreferencePanes/
My*
sudo
rm
-rf
/
Library/
Receipts/
mysql*
sudo
rm
-rf
/
Library/
Receipts/
MySQL*
sudo
rm
-rf
/
private/
var/
db/
receipts/*
mysql*
Open the file “hostconfig” with the command “sudo nano /etc/hostconfig” and remove the line MYSQLCOM=-YES-.
Installing PhpMyAdminPhpMyAdmin is basically a bunch of PHP files, so installing them is a breeze.
1. Download PhpMyAdmin from its website.
2. Extract the compressed file to your Sites folder and rename it as “phpmyadmin”.
3. Open the “phpmyadmin” folder and create a new folder call “config”. Change its permission with the command:
6. Go to the “Authentication” tab and enter MySQL root password in the “Password for config auth” field.
7. Lastly, enter the following commands in the terminal:
sudo
mkdir
/
var
/
mysql
ConclusionIt will probably be easier if you install a third party tool like MAMP, but that will add duplicate features to what is already available in your Mac. With a little tinkering, you can easily get your Mac to be a web server for all your web hosting needs.
Damien
Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.
You're reading How To Setup A Web Server In Mac Os X Mountain Lion
Apple Seeds Os X Mountain Lion 10.8.3 Build 12D50 To Developers
Shortly after releasing 10.8.3 build 12D43 to developers, Apple is today seeding build 12D50 with no known issues. Apple isn’t listing any significant changes, but it asked developers to once again focus on AirPlay, AirPort, Game Center, Graphics Drivers, and Safari. The full release notes are available below.
OS X Mountain Lion 10.8.3 build 12D50 Seed Note
OS X Mountain Lion Update 10.8.3 is an update to OS X Mountain Lion 10.8.
Installation Instructions
Please be aware that you will not be able to revert back to your previous system after updating. Please install this update on a system you are prepared to erase if necessary.
– If you have already installed the “OS X Software Update Seed Configuration Utility”, choose “Software Update” from the Apple menu. Otherwise, proceed with the following steps.
– To stop receiving new seed builds, go to the Software Update Preference in System Preferences and where it says “Your computer is set to receive pre- release Software Update seeds”, press the “Change…” button.
Note: If you are using a computer which gets its updates from a local Software Update server, the OS X Software Update Seed Configuration Utility will reconfigure your machine to use Apple’s Software Update servers. Your computer must be able to connect to Apple’s Software Update servers to install the seed. We recommend that you remove any Configuration Profile that specifies a local Software Update server before installing the OS X Software Update Seed Configuration Utility.
Known Issues
– None
Focus Areas
– Graphics Drivers
– Safari
Bug Reporting
This build is being provided to you for testing and development purposes. Should you encounter any problems, please submit a bug report using the online Bug Reporter at chúng tôi Please make sure to include “10.8.3 (12D50)” in the bug title and description. This information will ensure that your bug is processed quickly.
When submitting a bug report, please make sure to include a Summary, Steps to Reproduce, Expected Results, Actual Results, and the diagnostic output generated by running ‘sudo sysdiagnose’ in the Terminal.
Thank you for your support, Worldwide Developer Relations Apple, Inc.
Legal Notices
The OS X pre-release software identified above and the OS X Software Update Seed Configuration Utility are Apple Confidential Information and your use of such software is subject to your Registered Apple Developer Agreement, Mac Developer Program License Agreement, and the applicable license agreements accompanying such software. Distributing such software to anyone other than another Registered Apple Developer who is working for the same entity as you is considered a violation of your agreement with Apple and is damaging to both Apple and those who develop for the Apple platform. We sincerely appreciate your efforts to keep this Apple software Confidential.
You agree that you will not export or reexport any of the software or Confidential Information received from Apple (a) into (or to a national or resident of) any U.S. embargoed countries or (b) to anyone on the U.S. Treasury Department’s list of Specially Designated Nationals or the U.S. Department of Commerce Denied Person’s List or Entity List. You also agree that you will not use said software for any purposes where prohibited by United States law, including, without limitation, the development, design, manufacture or production of nuclear, missile, chemical or biological weapons.
Change File Permissions In Mac Os X
You can instantly change file permissions in Mac OS X without getting your hands dirty in the command line by using the Finder instead. All you need to do is access the “Get Info” panel for the file, folder, or application in question. These instructions demonstrate locating the file permissions manager, and how to adjust privileges for items found in Mac OS.
It’s worth mentioning that you can also use this trick to quickly view current file and folder permissions and ownership details in the Mac OS X Finder. To view permissions, just use the Get Info panel as described below but don’t make any modifications. Mac OS X calls permissions “Privileges”, but they mean the same thing.
How to Change File Permissions on Mac
This is the most user friendly way to view or adjust file permissions in Mac OS X, it works with anything found in the Finder file system, be it a file, binary, application, or a folder. Here’s what you’ll want to do:
Select the file or app in the Finder you want to edit permissions for
At the bottom of the Get Info window, you’ll see “Sharing & Permissions”, select the arrow to drop down the options
Adjust permissions* on a per user basis, the options being: read and write, read only, or no access
When finished, just close out of the Get Info window. The changes to permissions happen immediately as you select items from the privilege option dropdown menus.
Permission Types & Explanations of LimitationsThe permissions options are fairly self-descriptive in their naming, but here’s a quick overview in case you’re new to the concepts on a file level:
Read & Write: The user can both read the file, and write to the file (make changes, modify the file, delete it, etc)
Read Only: The user can only read the file, and is therefor unable to make changes to the file
No Access: The user has no access to the file at all, meaning the user can not read the file or write to it
When you’re finished setting the desired permissions and privileges, close the Get Info window and the changes will take effect immediately.
Notice that you can’t make files executable through this the Get Info panels, you’ll still need to pull up the terminal for that.
One of our readers pointed out that you can use Get Info to adjust file permissions on remote files using the Mac OS X built-in FTP client, which is pretty convenient if you’re without a separate FTP app but you’re remotely needing to change privileges on something.
Generally speaking, if you’re not sure what to set, you shouldn’t mess around with file permissions since it can change the way a file or application responds to a given document. This is particularly true with system files and applications, as permissions can mean the difference between some apps working and some not. If you’re digging around because of frequent errors regarding access to files or ownership, try using the Recovery Mode method of repairing user permissions that works with Mac OS X 10.7, 10.8, 10.9, 10.10, macOS 10.12, 10.11, 10.13, etc, which can usually sort out those problems automatically without any manual modification of files.
You can also modify permissions from the command line using the ‘chmod’ command followed by flags or sequences and a file name, but that’s really a topic for another article.
Related
How To Hack A Web Server
Customers usually turn to the internet to get information and buy products and services. Towards that end, most organizations have websites. Most websites store valuable information such as credit card numbers, email address and passwords, etc. This has made them targets to attackers. Defaced websites can also be used to communicate religious or political ideologies etc.
In this tutorial, we will introduce you toweb servers hacking techniques and how you can protect servers from such attacks.
How to Hack a Web ServerIn this practical scenario, we are going to look at the anatomy of a web server attack. We will assume we are targeting chúng tôi We are not actually going to hack into it as this is illegal. We will only use the domain for educational purposes.
Step 1) What we will need
Bing search engine
SQL Injection Tools
Stept 2) Information gathering
We will need to get the IP address of our target and find other websites that share the same IP address.
We will use an online tool to find the target’s IP address and other websites sharing the IP address
Enter chúng tôi as the target
You will get the following results
Based on the above results, the IP address of the target is 69.195.124.112
We also found out that there are 403 domains on the same web server.
Our next step is to scan the other websites for SQL injection vulnerabilities. Note: if we can find a SQL vulnerable on the target, then we would directly exploit it without considering other websites.
Enter the URL chúng tôi into your web browser. This will only work with Bing so don’t use other search engines such as google or yahoo
Enter the following search query
ip:69.195.124.112 .php?id=
HERE,
“ip:69.195.124.112” limits the search to all the websites hosted on the web server with IP address 69.195.124.112
“.php?id=” search for URL GET variables used a parameters for SQL statements.
You will get the following results
As you can see from the above results, all the websites using GET variables as parameters for SQL injection have been listed.
The next logic step would be to scan the listed websites for SQL Injection vulnerabilities. You can do this using manual SQL injection or use tools listed in this article on SQL Injection.
Step 3) Uploading the PHP Shell
Open the URL where you uploaded the chúng tôi file.
You will get the following window
Once you have access to the files, you can get login credentials to the database and do whatever you want such as defacement, downloading data such as emails, etc.
Web server vulnerabilities
Default settings– These settings such as default user id and passwords can be easily guessed by the attackers. Default settings might also allow performing certain tasks such as running commands on the server which can be exploited.
Misconfiguration of operating systems and networks – certain configuration such as allowing users to execute commands on the server can be dangerous if the user does not have a good password.
Bugs in the operating system and web servers– discovered bugs in the operating system or web server software can also be exploited to gain unauthorized access to the system.
In additional to the above-mentioned web server vulnerabilities, the following can also led to unauthorized access
Lack of security policy and procedures– lack of a security policy and procedures such as updating antivirus software, patching the operating system and web server software can create security loop holes for attackers.
Types of Web ServersThe following is a list of the common web servers
Apache– This is the commonly used web server on the internet. It is cross platform but is it’s usually installed on Linux. Most PHP websites are hosted on Apache servers.
Internet Information Services (IIS)– It is developed by Microsoft. It runs on Windows and is the second most used web server on the internet. Most asp and aspx websites are hosted on IIS servers.
Apache Tomcat – Most Java server pages (JSP) websites are hosted on this type of web server.
Other web servers – These include Novell’s Web Server and IBM’s Lotus Domino servers.
Types of Attacks against Web ServersDirectory traversal attacks– This type of attacks exploits bugs in the web server to gain unauthorized access to files and folders that are not in the public domain. Once the attacker has gained access, they can download sensitive information, execute commands on the server or install malicious software.
Denial of Service Attacks– With this type of attack, the web server may crash or become unavailable to the legitimate users.
Domain Name System Hijacking – With this type of attacker, the DNS setting are changed to point to the attacker’s web server. All traffic that was supposed to be sent to the web server is redirected to the wrong one.
Sniffing– Unencrypted data sent over the network may be intercepted and used to gain unauthorized access to the web server.
Phishing– With this type of attack, the attack impersonates the websites and directs traffic to the fake website. Unsuspecting users may be tricked into submitting sensitive data such as login details, credit card numbers, etc.
Pharming– With this type of attack, the attacker compromises the Domain Name System (DNS) servers or on the user computer so that traffic is directed to a malicious site.
Defacement– With this type of attack, the attacker replaces the organization’s website with a different page that contains the hacker’s name, images and may include background music and messages.
Effects of successful attacks
An organization’s reputation can be ruined if the attacker edits the website content and includes malicious information or links to a porn website
The web server can be used to install malicious software on users who visit the compromised website. The malicious software downloaded onto the visitor’s computer can be a virus, Trojan or Botnet Software, etc.
Compromised user data may be used for fraudulent activities which may lead to business loss or lawsuits from the users who entrusted their details with the organization
Web server attack toolsSome of the common web server attack tools include;
Metasploit– this is an open source tool for developing, testing and using exploit code. It can be used to discover vulnerabilities in web servers and write exploits that can be used to compromise the server.
MPack– this is a web exploitation tool. It was written in PHP and is backed by MySQL as the database engine. Once a web server has been compromised using MPack, all traffic to it is redirected to malicious download websites.
Zeus– this tool can be used to turn a compromised computer into a bot or zombie. A bot is a compromised computer which is used to perform internet-based attacks. A botnet is a collection of compromised computers. The botnet can then be used in a denial of service attack or sending spam mails.
Neosplit – this tool can be used to install programs, delete programs, replicating it, etc.
How to avoid attacks on Web serverAn organization can adopt the following policy to protect itself against web server attacks.
Patch management– this involves installing patches to help secure the server. A patch is an update that fixes a bug in the software. The patches can be applied to the operating system and the web server system.
Secure installation and configuration of the operating system
Secure installation and configuration of the web server software
Vulnerability scanning system– these include tools such as Snort, NMap, Scanner Access Now Easy (SANE)
Firewalls can be used to stop simple DoS attacks by blocking all traffic coming the identify source IP addresses of the attacker.
Antivirus software can be used to remove malicious software on the server
Disabling Remote Administration
Default accounts and unused accounts must be removed from the system
Default ports & settings (like FTP at port 21) should be changed to custom port & settings (FTP port at 5069)
Summary
Web server stored valuable information and are accessible to the public domain. This makes them targets for attackers.
The commonly used web servers include Apache and Internet Information Service IIS
Popular web server hacking tools include Neosploit, MPack, and ZeuS.
A good security policy can reduce the chances of been attacked
Expand Google Chrome Horizontally In Mac Os X
Note: this only applies to Google Chrome in Mac OS X. It will not work for any other application.
Damien
Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.
How To Navigate Mail Messages With The Keyboard In Mac Os X
To use keyboard email navigation in the Mac Mail app, you’ll want to start at the primary double or triple pane primary Inbox screen as if you just opened Mail. The rest is just a matter of using the keyboard rather than the mouse, and making a new habit of that.
Basic Mac Mail App Navigation with Keyboard Shortcuts
Use the Up / Down arrows to navigate to the next or previous email message and open the selected message in the mail panel
Use the Spacebar to scroll down in the selected mail message
Use the Tab key to switch the currently active panel (Search box, Mailboxes, Inbox, Message content
That will allow you to move between the next and previous mail message using just the keyboard, but if you want to start replying to, forwarding, marking as unread, and other common mail activities, you’ll want to use some other keyboard shortcuts.
By the way, if you find the email content text to be either too small or too big, you can change the font size in Mail rather easily.
Of course, navigating between the next and previous message in your inbox is one thing, you’ll likely want to interact with those messages to, which is where the next set of keyboard shortcuts comes in for a variety of tasks in Mail app for Mac OS X.
Other Helpful Mail App Keyboard Tricks for Mac
Hit Command+R to reply to the currently selected message
Hit Command+Shift+D to send an active message, reply, or forward
Hit Command+Shift+U to mark as unread the selected message
Hit Command+N to create a new eMail message
Hit Command+Shift+F to forward the selected message
Hit the Return key to open the selected message into a new window
Use Command+W to close an open message, or the primary message window
Use Command+0 (zero) to return to the message viewing window if you accidentally close it
There are many other keyboard shortcuts for Mail in MacOS X, but these are some of the essentials that are worth remembering without being overloaded with some of the more obscure options. Exploring the Mail menu items will reveal many more, and you can always create a custom keystroke for something if you discover a menu item function that doesn’t yet have an attached keyboard shortcut.
At the moment, the Mail app in Mac OS X does not include a “Next Message” or “Previous Message” keyboard shortcut that is independent of the arrow keys for selecting messages, which can lead to some confusion for users who have turned to the Mail app in Mac OS X as their default email client, particularly if they came to Mail from another email client like MS Outlook or Thunderbird. Note that none of these keyboard shortcuts for moving around Mail are specific to any version of Mac OS X, they’ve been on the Mac for quite some time and therefore will work regardless of the computer running MacOS Mojave, High Sierra, Sierra, El Capitan, Mac OS X Yosemite, Mavericks, Mountain Lion, Snow Leopard, and likely just about any other version too.
Considering that iOS does include a “Next” and “Previous” message button in the Mail app on iPhone and iPad, it wouldn’t be too surprising if such a feature was added to the Mac sometime in the future. In the meantime, use the arrow keys and spacebar trick, it’s effective and makes browsing through a ton of emails quite fast.
Related
Update the detailed information about How To Setup A Web Server In Mac Os X Mountain Lion on the Kientrucdochoi.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!