The mysql56 directory and settings4.plist copied over to the corresponding places on the new Mac. The problem is, I am using a different username on the new Mac so all of the virtualhosts paths (root directories) are incorrect – they include the former username.
Sure, I can manually update each one via MAMP Pro gui, but I have over 100 virtualhost names. I thought updating both httpd.conf files ( ~/Library/Application Support/appsolute/MAMP PRO/httpd.conf and
/Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf) would resolve the issue, but it doesn't.
Instead, it re-writes both httpd.conf files back to the old username once Apache is started.
Is there a simple way to fix this?
This is a late reply to when OP posted, but I recently encountered this problem too when transferring hard drives.
I was able to fix this by copying and replacing the full folders of BOTH:
/Users/yourUserName/Library/Application Support/appsolute/MAMP PRO
(minus the db folder unless you want to transfer those too)
and
/Library/Application Support/appsolute/MAMP PRO/conf
Once I replaced these, all of my previous hard drive's virtual hosts appeared.
If your username and root directory are different, you most likely will need to do a text search and replace. Replace the old path with your new path on both httpd.conf files and the httpd-ssl.conf (if you used SSL) which are in the folders I listed above.
Related
I am running into some sort of issue when trying to access my local website:
Forbidden
You don't have permission to access /index.html on this server.
Apache Server at ffghost.local Port 34580
I'm using macOS X Server 5.2 with Apache 2.4.18. OS X Server automatically creates two default websites (one on port 80 and one on port 443). I created a new website. It was my understanding that Apache would redirect from the default site to the created site automatically once created. This didn't happen. So, in an attempt to begin de-conflicting I replaced the files where the default site was located with the new website files and all of the sudden am getting the above 404 message.
I have read a lot of possibilities as to why this may be happening. I've run a syntax checker for Apache in terminal and terminal says syntax is ok. So from there I was going to check into the config files, but there are several, and I just want to know the gist behind them.
There seem to be about 4 file extension types. I don't know what they all mean or if they are active.
.config (I'm assuming this is the active file)
.config.prev (I'm assuming this is a previous version or copy of an active config file and is no longer active)
.config.orig (original file? and is no longer active)
.config.default (???)
Also, OS X Server and Apache seem to have the same files in two different places and I'm a little confused on which one to change. If I change one of them will it be reflected in the other? Do I need to change both of them? Additionally, I don't have DNS set up and am unsure if that was the original issue of not pulling up the new website over the default site.
You are mixing several aspects in your question which makes it complicated to give a helpful answer. For example, you say you get Forbidden when accessing your site, but later you mention a status 404. The former might be due to configuring a user group being allowed to access the site, while the latter just means Not found.
As to your actual question about the config files:
The file just ending in .conf is the one that is being used.
However, the Server app uses a lot of of different config files which might be relevant:
Path /Library/Server/Web/Config/apache2 contains the general config files
httpd.conf - general Apache configuration
httpd_server_app.conf - more general configuration
the other files contain configurations for specific applications or webapps (the latter being defined in plist files in /Library/Server/Web/Config/apache2/webapps)
Path /Library/Server/Web/Config/apache2/sites contains config files specific to your websites. They are named something like 0000_127.0.0.1_34543_your.domain.name.conf where 34543 is the configuration for the https (SSL) port, while 35480 would indicate the http port. There is also a file like 0000_127.0.0.1_34543_.conf (no domain name in the file name) which defines the default site.
In addition to these, there are two more configuration file in /Library/Server/Web/Config/proxy which configure the proxy services.
It is not recommended to manually adjust the config files, except for those in the sites subdirectory, because they may get overwritten by the Server app or when updating the Server app.
Important: If you change the files manually, you must re-start the Apache server in order to make the changes effective. Use sudo serveradmin stop/start web to do so.
However, I do not know of a detailed documentation of of all these files, so I try to stay on the safe side and possibly not edit the general config files (only those in sites). I also recommend to write down any manual changes, so they can be reapplied if necessary.
Without exactly knowing what you configured in the Server app and which files you changed how, I'm afraid it is impossible to say what might have gone wrong. I recommend to start all over by removing and re-adding the web sites.
I am kind of new to vagrant and all of this (used xampp untill now for learning). Anyway, I am currently using puphpet to setup my boxes, and its working great.
But, I now have a question about config.yaml file. Under vhosts, what is the difference between docroot, and directories/avd_8.../path?
Do they have to be the same?
Docroot is the root folder of my whole project? Its where I have my index.php? If so, how is path different from it then?
Also, if I want to keep some files out of public directory, do I just keep them one directory back from docroot?
Thanks.
Edit: here is part of my config.yaml file that contains those 2 settings: http://imgur.com/a/8dC99
We have a SaaS product and we give websites for customers. The customers can request to have their own domain pointed to their website. At the moment we use httpd.conf file to add a VirtualHost entry pointing to the same document directory. Afterwards the database will load the website by matching the URL. We have CentOS installed.
I think this is quite risky because if there is a mistake in httpd.conf file their is potential the whole product might not work. This has actually happen. Also, we use WHM and cPanel, so when we add a mod or does a server tweak the entire httpd.conf gets rewritten having us to replace/add existing virtual host entries to the file.
I will need a solution where i can add VirtualHost entries in a separate conf file or multiple conf files and load them via httpd.conf file which should automatically pick the newly added file/files without having to restart the server.
Can someone point me in the right direction where i can achieve the above.
Cheers!
You dont need to restart, just reload
In the same folder as the active Apache httpd.conf file are a set of httpd.conf.work.[hash] files. Where [hash] is an 8 character hash consisting of a-z A-Z 0-9 and _
The data they contain is essentially an `httpd.conf' file which suggests one is generated each time the main config file is updated and working.
I can see from a search that in some cases it stops a WHM CentOS install from updating after using the include config options.
Are they Cent OS specific? Can they be deleted? Why do the cause the include error above when they aren't referenced in httpd.conf file?
As far as I know, every time you do change the apache configuration, cPanel/WHM scripts automatically store the previous configuration as httpd.conf.bak. This happens when you modify your apache configuration from WHM (and not by manually editing the httpd.conf file).
I can't provide you a proper answer about the hash files but as a suggestion you could ask that on cPanel forums. I am pretty sure that you will receive the desired answer from any of the cPanel/WHM staff guys.
So I am at my wits end with this problem of trying to configure a simple Apache Web Server for one of my assignments. For some reason my changes to index.html are no longer being read, even though I got it to change previously.
I had this problem previously, where I would change index.html and it would still show the default "It works!" message. It ended up that, because my file extensions weren't shown, I had accidentally named the file index.html.html, and so obviously it wasn't locating it.
However, now that my file extensions are showing, I am having this problem again (the last fiasco was about a week or two ago). I tried changing the contents of index.html again, just a simple text change, and it is still loading my previous page. I have tried restarting Apache through Administrative Tools > Services since the Apache and httpd commands in the command line won't work for me. I even tried deleting the index.html file and leaving htdocs empty and it's still displaying my old web page!!!
I have no idea why it's doing this and I can't find any other answers. I checked my DirectoryRoot and DirectoryIndex values and they all point to index.html (and plus, I haven't touched httpd.conf since installation anyways). Running Windows 8.1. Any help greatly appreciated.
Modern Windows has a feature that copies some files when non-administrator edit them. You see the changes, but the service doesn't. Try editing your files as Administrator (not just someone with Administrator group privileges)