MAMP Apache document root keeps resetting - mamp

I have MAMP setup on Windows for localhost development.
And I'm pointing the Apache document root to a folder inside DropBox (for automatic backup of media files etc).
It works great, but each time I close and restart MAMP the Apache folder location gets reset to the default C:\MAMP\htdocs location.
So I have to go into the settings each time and point it to the correct DropBox folder location. How can I stop it from resetting each time?

Related

Folder disappeared after reboot in CentOS

I am a Windows user new to CentOS 7.
I was running as root, and did some development work. I created a folder called 'docker' under '/dev'. During development I edited several files in Kwrite, and this session went of for several hours.
Then I rebooted the machine, whole '/dev/docker' folder is missing. And KWrite's recent folder list does not show my files. As if yesterday never happened :-).
Few months ago I faced same problem, and this happens randomly.
/dev is a special file system for devices. It gets recreated and repopulated by the kernel when your computer starts up.
It should not be used for general files - documents, source code, music etc.
Also, you shouldn't be running as root. Create a user and keep your files in /home/username.
If you have to run as root, root's home directory is /root

Moved site to new drive, DB won't work with old drive removed

I have a site in MAMP-PRO for windows (installed on C drive) that I need to move due to a failing drive (F drive). I have moved the site folder to the new drive (N drive) and changed the path for the host in MAMP settings and restarted the servers - everything works fine. When I remove the failing drive, I can not get the site to connect to it's database (regular sites, HTML/PHP only, work fine), but anything database related (like wordpress) just tried to load indefinitely. When I put the failing drive back in - everything works again. I have validated that even with the failing drive in, changes on the new drive are what is reflected in the browser, so I know that the host file and document root changes are working, it's the database connection that seems to be the issue. I have no idea why this would be. Any suggestions?
Solved. Caching plugin in Wordpress was the culprit.

Netbeans Remote Synchronize doesn't list files when a subdirectory is used as upload directory

I've setup several sites previously to use Netbeans Remote Synchronization so I can edit files on the server from my machine and it has worked perfectly.
The problem I'm having right now is that when my FTP configuration in Netbeans uses the root folder it lists everything correctly but when I use a sub directory for example website.com/subdir as the upload directory or as the FTP initial directory the sync results come up blank - doesn't list anything at all on the remote side except directories in that sub directory.
My PC is a windows 7 64 bit machine, and the server is a standard shared hosting account running CPanel.
Also, I have been able to run the subdir synchronization on a different pc, could it be the firewall on this one? If so, why does it list the root folder properly?
Has anyone else had this issue? Any suggestions on how to fix it?
Thanks.
found the problem. The FTP path on this PC required the /public_html before the subfolder paths. i.e. essentially ftp://mydomain.com/public_html/path/to/subfolder
This wasn't the case on my laptop as I used the subfolder path right after the domain i.e. ftp://mydomain.com/path/to/subfolder and it worked fine, different versions of netbeans perhaps.

Is there a way to get the absolute path of the context root in tomcat?

I have a problem that, after a lot of reading and research, seems like tomcat is running another instance of itself and thus serving an old version of my updated app (or somehow has cached an older version of my webapp somewhere only serves that.)
I work on the app in eclipse on a windows machine and deploy it on a Linux server as a ROOT app (Renaming the war file to a ROOT.war).
What I'd like to know is if there's a way to locate the older version that tomcat is serving by getting tomcat to log an output of the context root of the servlet that's serving the older version of the app.
As it stands it the moment any files created by the updated app get created in the right directory but because the app instances are different it can't access the files shortly after they're created.
Any help/hints would be welcomed
To answer the question in the title, let your code basically do the following:
System.out.println(getServletContext().getRealPath("/"));
To solve the problem described in the question, shutdown Tomcat and delete everything in its /work directory, delete the expanded WAR in /webapps and remove the /Catalina subdirectory of /conf directory (if any) and then restart.

Move / backup Netbeans FTP profiles

Trying to figure out how to transfer / back remote connections in netbeans. I have over 100 that I would like to move to a backup computer. Recreating every one of them would be extremely time intensive. I cannot find any way to export the remote profiles and I haven't been able to find the profiles in the .netbeans directory on the local computer.
Is there a file, or any method that would allow moving or backing up the FTP profiles.
The location changed in Netbeans 7.2. The path is the same except AppData\Roaming instead of AppData\Local.
If you are setting up a new windows machine to run Netbeans, you need to first create a dummy remote ftp connection so Netbeans will create the last folder in this file path. Place the .properties files here and then restart Netbeans.
C:\Users\[windowsUsername]\AppData\Roaming\NetBeans\7.2.1\config\Preferences\org\netbeans\modules\php\project\RemoteConnections
The path on Windows would be:
user\.netbeans\6.7\config\Preferences\org\netbeans\modules\php\project\RemoteConnections
For Windows 10:
C:\Users\ (username) \AppData\Roaming\NetBeans\ (netbeans_version) \config\Preferences\org\netbeans\modules\php\project\RemoteConnections