Cant access solr XML url from apache php - apache

I am trying to use apache to access a XML from tomcat url like so:
http://localhost:8081/solr-example/select/?q=blah&version=2.2&start=0&rows=10&indent=on
However, I am getting a permission denied error. I have tried chown, chmod and chcon on both the tomcat and solr directories and it still gives me the error.
I am on centos/linux. Any help with this is much appreciated.
Cheers :)
Ke

Possibles solutions:
Check if the xml is under WEB-INF
directory.
Change the owner of the document to 'apache'.
PS: If you could post some of the log information, the detailed error (denied from what? the server, the SO, it's a 303 forbidden, etc) it will help.

This is due to SELinux enforcing
By default, only port 80 is allowed to do HTTP. You can add non standard ports using the command
semanage port -a -t http_port_t -p tcp 8081
I had the same issue with SOLR, which I solved using the above command.
It is explained here:
http://digitalpbk.blogspot.com/2011/10/solve-failed-to-query-solr-using-errno.html

Related

phpMyAdmin 500 Internal Server Error

today I built a droplet from DigitalOcean, I installed LAMP and phpMyAdmin without any problem. After that for copy my old website to my new droplet, I tried to use ftp. I used vsftpd, created a user for it, changed the ufw permissions little bit, changed some settings from vsftpd.conf and that's all. Now I am trying to access phpmyadmin but
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request....Apache/2.4.18 (Ubuntu) Server at xxx.xx.xxx.xxx Port 80
sudo service apache2 status
OUTPUT:
netstat -ln | grep -E ':80|443'
OUTPUT: tcp6 0 0 :::80 :::* LISTEN
Its hard to diagnose the exact problem from your Error, I would start with:
Check that the server is running correctly (in Ubuntu sudo service apache2 status)
Check Apache is listening on port 80 (in Ubuntu netstat -ln | grep -E ':80|443'
Make sure the phpmyadmin permissions are correct (directory and files usually needs to be owned by the web server user www-data with proper access permissions)
Check the apache virtual host file to see if you have the right Directory configuration (usually phpmyadmin will have sample values in the setup file)
If all of that does not point you in the right direction to fix the issue you will need to start looking through your logs in /var/log/apache2/ and get some more detailed error messages.
Error 500 doesn't mean Apache listening issue. you should open your log file to see what problem occurred. usually, Apache error log is located in this PATH
/var/log/apache2/error.log if you didn't specify a custom log file for your virtual host. append error from the end of file in your question.

How can I set virtual host in Codeship?

I’m using Codeship to automate a multi-tenancy application.
My app need subdomain setting to run acceptance tests using Selenium Web Driver.
So, I need to config virtual domain for my app.
For example, I need the following virtual domain:
127.0.0.1 test.my-app.test
127.0.0.1 my-app.test
If I do not use subdomain to request to my app, It not work as requirement.
I tried the following commands in Setup Commands section before Test Pipelines.
sudo echo '127.0.0.1 test.my-app.test' >> /etc/hosts
sudo echo '127.0.0.1 my-app.test' >> /etc/hosts
But, It doesn’t work, because I has no permission. The error message was:
bash: /etc/hosts: Permission denied
Would you mind tell me how to make it work ?
Thank you in advanced !
Update:
I received reply from Codeship team:
this is not possible in our classic infrastructure due to technical limitations. You could move to our Docker Platform, which allows more customization of your build environment.
We need to use Docker to solve this issue
Your redirected command will not be executed in the root privilege, that's why you got the Permission denied error.
Your command means "do the echo in the privilege root, then redirected to /etc/hosts file".
Try this:
sudo sh -c 'echo "Your text" >> /path/to/file'
We don't allow access via sudo on the build VMs because of security considerations.
However, you can use a service like http://xip.io/ or lvh.me to access your application via DNS names.
$ nslookup codeship.lvh.me
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: codeship.lvh.me
Address: 127.0.0.1
lvh.me will resolve any requests to a subdomain to 127.0.0.1, xip.io offers more functionality, that is explained on its homepage in more detail.

Apache script config with loggly

I am trying to configure loggly in apache in my ubuntu machine.
What I have done is
curl -O https://www.loggly.com/install/configure-apache.sh
sudo bash configure-apache.sh -a XXXXXX -u XXXXXX
After entering the last line it's saying
ERROR: Apache logs did not make to Loggly in time. Please check network and firewall settings and retry.
Manual instructions to configure Apache2 is available at https://www.loggly.com/docs/sending-apache-logs/. Rsyslog troubleshooting instructions are available at https://www.loggly.com/docs/troubleshooting-rsyslog/
Any idea why it's showing and how to solve it?
This is likely a network issue or a delay in sending the logs or even an issue with the script. Check out the following link that has the manual instructions. https://www.loggly.com/docs/sending-apache-logs/ that you can follow and use to verify the script created the configuration files correctly.

FATAL: no pg_hba.conf entry for host "fe80::1%lo0"

Can someone help me why this is happening when I'm trying to connect to database or rails s?
In my pg_hba.conf file I have this:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication Andrew trust
#host replication Andrew 127.0.0.1/32 trust
#host replication Andrew ::1/128 trust
local all all md5
Maybe I'm doing it wrong?
Thanks
I had the same problem. somehow, this line was added to my /etc/hosts file:
fe80::1%lo0 localhost
commenting out or removing that line from /etc/hosts should fix it
sudo vi /etc/hosts
#fe80::1%lo0 localhost
I'm on OSX 10.9.3 and Postgres 9.3.4.
I've managed to resolve this problem in the following way:
First find your pg_hba.conf file by starting up psql with psql -h 127.0.0.1 and executing SHOW hba_file;:
hba_file
-------------------------------------
/usr/local/var/postgres/pg_hba.conf
(1 row)
Now add the following line to pg_hba.conf:
host all all fe80::1%lo0/128 trust
and reload the configuration via select pg_reload_conf(); within psql.
Now you should be able to connect via psql -h fe80::1%lo0.
Oo, that's an interesting one.
Assuming you're connecting to localhost (you didn't say and didn't show your database.yml), it appears that localhost is resolving to an IPv6 link-local address with zone index.
If you use ::1 or 127.0.0.1 it should work.
This is very likely an operating system misconfiguration or bug, so lots more detail (see comment above) should be added to the question if you want any concrete advice on that.
For me, the cause was calling sudo rails server -p 80.
I bound the rails server to port 80 so that I wouldn't have to specify a port in the url localhost:3000 during development. This appears to write fe80::1%lo0»localhost to my /etc/hosts file.
Try commenting out the line in your hosts file, then running rails s -p 3000
Actually,
The same error occurs for me when I execute pg_dump command to take backup of my server database (external) like below
'/Applications/Postgres.app/Contents/Versions/9.3/bin'/pg_dump -d "<database_name>" -h <server_name> -U <db_user_name> -f <destination_path>
I solved it (work around) by replacing my <server_name> to my actual server IP (10.1.0.18).
So the issue here is my system didn't understand the <server_name> host.
It might solve permanently when you add <server_name> host in /private/etc/hosts file.
Another variant: if IPv6 is not used in the network, you can just disable it. On Windows IPv6 service also can be disabled.

svn:// not working but http:// is

If I try to checkout a repo from a Debian server via svn://example.com/svn/repo I get the following error:
Unable to connect to a repository at URL
'svn://example.com/svn/repo'
No repository found in 'svn://example.com/svn/repo'
I get the same same error when trying to checkout from the server via the shell.
It works if I use "http://example.com/svn/repo" and the repo definitely exists.
svnserve is running as a daemon listening on port 3690 (UDP/TCP).
What am I missing?
I am pretty sure that you are accessing the wrong URL. Note that the path component of the svn:// URL (srv/repo in your case) is interpreted relative to what you pass to the -r argument of svnserve.
Other possible reasons are:
svnserve is not configured properly,
there is a firewall in the way.
I know it has been already answered but for future references, enabling port 3690 in firewall worked for me.
firewall-cmd --zone=public --add-port=3690/tcp --permanent
firewall-cmd --zone=public --add-port=3690/udp --permanent
firewall-cmd --reload