IntelliJ needs to copy tomcat/conf directory to project directory - spring

I have a freshly installed Tomcat 7 server, and I'm trying to make IntelliJ deploy a HelloWorld Spring MVC app to Tomcat.
My Tomcat home is /usr/share/tomcat7 and Tomcat base is /var/lib/tomcat7
However, when I try to run the project, IntelliJ throws an error saying:
Error running Tomcat : Error copying configuration files from /var/lib/tomcat7/conf to /home/adonis/.IntelliJIdea12/system/tomcat/Tomcat__SpringMVCApp/conf : /var/lib/tomcat7/conf/tomcat-users.xml (Permission denied)
Here is a screenshot - http://i.imgur.com/CQ3z0e1.png
Any permissions I need to set up?

Try chmod -R 777 /var/lib/tomcat7/conf/, it works to me.

Make sure that files under /var/lib/tomcat7/conf/ directory have read permission for the user IntelliJ IDEA is running from.
chmod -R 644 /var/lib/tomcat7/conf/
should help.
Also check that /home/adonis/.IntelliJIdea12/system/tomcat/ has correct permissions and owner. Could be that it was created from a different user and your current user doesn't have the rights to write into it.
If it doesn't help, download and unpack a new Tomcat installation from .tar.gz file, configure IDEA to use this installation instead.
Note that Tomcat installed using the package manager on some Linux systems has non-standard layout and permissions, and therefore will not work with IDEA.

I had the same problem and these steps helped me to Start my tomcat7 from Intellij :
I have Linux Mint 17,and Tomcat 7 which is installed using apt-get
CATALINA_HOME in /usr/share/tomcat7 and CATALINA_BASE in /var/lib/tomcat7
1- First I created a soft link which references /etc/tomcat7
cd /usr/share/tomcat7
ln -s /etc/tomcat7 conf
2- Then you have to change the access permissions of /etc/tomcat7
sudo chmod -R 655 /etc/tomcat7/
That's it.

For me, this worked for Tomcat 8 on Manjaro Linux:
sudo chmod -R 755 /usr/share/tomcat8/

I added my own user account to the tomcat7 group.
And chmod g+r /var/lib/tomcat7/conf/tomcat-users.xml

Had the same error with usr/share, dont just blindly run a command to act as magic-wand as many just tell you you run this and that on a mother-directory.
this is Linux, always some stupid thing with the permissions.
all you garra do is using chmod 666 or chmod 777 on files that are causing the error, but you need to look at those files first using ll and ls to make sure you are not decreasing some access, you may have a directory with 77x and when you do 666 you mess things up.
just gradually and one by one increase the chmod level and check whether problem goes away or not.
Sorry I didn't give you some code to fix all the problems.

This also happens to me, and I managed to solve it for Tomcat version 9, this problem is related to the configuration of Tomcat and you just need to give it permissions to be deployed.
You can use this link for more instructions.

Related

How to send war file from local to aws server using putty?

I am trying to send war file built in Java Web application to AWS EC2 instance. Here is the command which I have far used for sending war file.
cd/ usr/share/tomcat8/webapps/
As I have my previous war file in this folder. After that I have use command ls from which something like this come
com.metokart com.metokart.war host-manager manager ROOT ROOT-OLD-1
At this .war is the previous one, First I have rename the folder ROOT to another name using this command-
sudo mv ROOT ROOT-OLD-6
After that I have deleted both the .war file and com.metokart folder from the webapps
sudo rm -rf com.metokart.war
sudo rm -rf com.metokart
Then I have gone to default directory to upload the new war file
sudo cp -i com.metokart.war /usr/share/tomcat8/webapps/
After that I have change the ROOT folder name back to ROOT.
sudo mv ROOT-OLD-6 ROOT
At last I have restarted my tomcat
sudo services tomcat8 restart
But still I don't know where I am doing the mistake. Hope anyone can help.
You should use pscp from within putty. Here is a helpful link that should guide you https://it.cornell.edu/managed-servers/transfer-files-using-putty.

Raspberry pi web server

I've been trying to set up my own web server with the raspberry pi3 b+ and it was going good so far i could made a ddns and access it from any other wifi or anything, the only problem was that i couldn't change the default "Debian apache" site.
I googled a lot about it and everybody said that all i have to do is change the root directory /var/www/to my directory but i just couldn't save the files, as it asked me if I wanna overwrite it - I pressed yes but it told me that I don't have permission for that I also couldn't overwrite the index.html file that was in the default folder. Is there anything I can do about it?
I had the same problem while doing this myself. You need to open terminal from the Raspberry Pi, or SSH. You need to change the folder type to 755, which allows the user to read,write,execute. Make sure that the directory you do this to is the /var/www/html folder.
All you need to do is type:
chmod -R 755 (dir)
dir = directory of the file.
If you'd like to change a file, such as the default index.html file in there, use 744 instead of 755.
After this, if you want to start the server, just type in
sudo service apache2 start
Here's a link for how to install the apache2 package.
https://pimylifeup.com/raspberry-pi-web-server/

Vagrant SSH Permissions

I am new to Vagrant and get the following error on vagrant up or vagrant ssh:
The private key to connect to this box via SSH has invalid permissions
set on it. The permissions of the private key should be set to 0600, otherwise SSH will
ignore the key. Vagrant tried to do this automatically for you but failed. Please set the
permissions on the following file to 0600 and then try running this command again:
[...]/.vagrant/machines/default/virtualbox/private_key
I have run:
$ sudo chmod 666 [...]/.vagrant/machines/default/virtualbox/private_key
I also tried (600, 777) but still get the same error.
Please can someone tell me what is wrong and how to fix it?
I just had this issue, and I worked around it moving the private_key file to another place, changing its permission, and then creating a symbolic link at the original place.
So,
$ mv [...]/.vagrant/machines/default/virtualbox/private_key /some/path/where/you/can/change/permissions
$ ln -s /some/path/where/you/can/change/permissions [...]/.vagrant/machines/default/virtualbox/private_key
If you're using the Windows Subsystem for Linux (WSL), this error can occur when you're trying to vagrant up in a directory that is outside the user's home directory.
From the Vagrant docs:
If a Vagrant project directory is not within the user's home directory on the Windows system, certain actions that include permission checks may fail (like vagrant ssh). When accessing Vagrant projects outside the WSL Vagrant will skip these permission checks when the project path is within the path defined in the VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH environment variable.
Changing the VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH to the current working directory (or a directory above it) can fix this. For example, if your project is in /mnt/c/www, then set the environment variable accordingly:
export VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH="/mnt/c/www"
I got the same error now. The problem happened because i was trying to do vagrant up in an NTFS partition, just like the error message tell me.
So i created an directory link in my ext4 partition and an simbloc link in my NTFS to solve this. Works Fine now!
Thanks!
I had this same problem and turns out chmod seems to be working fine but is not actually changing permissions, my files where at an NTFS partition, try changing them to an ext4 or similar.
Got this error using otto (which layers on vagrant)
It is def filesystem related, have a fat partition to allow use with windows (used to, no longer). When the permissions couldn't be set on the partition I just copied the whole directory over to my user directory (as I always should have).
Was using git so I just reset to head to get back to my starting place... re-ran:
otto compile
otto dev
up and running now.

Grails create-app error

Anyone know why I would get this error when trying to create a grails app using terminal.
mycomputer:test-apps mailboxe$ grails create-app demo
| Configuring classpath
| Error Error executing script CreateApp: /Users/bla/.grails/ivy-cache/resolved-org.grails.internal-grails-2.0.3.xml (Permission denied) (Use --stacktrace to see the full trace)
As #Phillip Tenn mentions, this is a permissions issue. Chances are something got installed into a cache with the sudo command so the root user owns the file and your normal user can't modify it.
The easiest thing to do is probably to just whack your ~/.grails directory, by default, there isn't anything but cached information in there. So unless you've put something in there manually (like a config file), it's safe to delete and let it regenerate with the next grails command. To do that, just:
cd ~
sudo rm -r .grails
It'll prompt you for your password to ensure you want to run this command as the root user.
Alternatively, you could try to find the offending file and chown it to your user and group (by default on OSX the group is staff). So for this example:
sudo chown bla:staff /Users/bla/.grails/ivy-cache/resolved-org.grails.internal-grails-2.0.3.xml
Grails needs to be able to write to a .grails folder under your user directory.
Without knowing the details of your development environment, the error message you are getting says (Permission denied) when you try to run grails create-app demo.
I would look into your directories:
/Users/bla/.grails/
/Users/bla/.grails/ivy-cache/
and ensure that you have proper write permissions.

Mac Lion Apache can't view files in document root

Apache is running, localhost is working, if I put an index.html that works as well. However I can't access any folders (my websites) within the document root, which is /Users/Me/Sites
I get a forbidden error when I try to access these.
What's going wrong?
You should check the permissions of your home folder and your sites directory to make sure that they allow Apache access.
You could check the permissions, or just run (in a Terminal)
chmod o+x $HOME
chmod -R o+rX $HOME/Sites

Resources