How to fix SolrException: Error loading solr config? - linux

So, my current setup looks like this:
Solr 4.10.4 with Tomcat7. Solr by itself is woring under localhost:8080/solr but as it wants to create a core it gets the following failure:
SolrCore Initialization Failures
atalanda_development: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core atalanda_development: Error loading solr config from /usr/share/solr/example/solr/development/conf/solrconfig.xml
So the first thought of mine was to check if the file is even there:
ll /usr/share/solr/example/solr/development/conf/solrconfig.xml
-rw-rw-r-- 1 tomcat7 gbeschbacher 71K Mar 16 13:56 /usr/share/solr/example/solr/development/conf/solrconfig.xml
So after this i knew the file was there and tomcat7 has the permission on it. I tried two versions of solrconfig.xml - a default one and a custom one. The error occured with both of these.
My Tomcat7 has the following solr.xml file which is pretty straight forward:
cat /etc/tomcat7/Catalina/localhost/solr.xml
<Context docBase="/usr/share/solr/example/solr/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/usr/share/solr/example/solr" override="true" />
</Context>
All it does it to tell tomcat7 where my docbase and my environment of solr is. For more understanding i show you the folder-structure with the permissions of my usr/share/solr/example/solr folder:
/u/s/s/e/solr ❯❯❯
drwxr-xr-x 2 tomcat7 gbeschbacher 4.0K Sep 8 2014 bin
drwxr-xr-x 3 tomcat7 gbeschbacher 4.0K Mar 18 23:06 collection1
drwxr-xr-x 2 tomcat7 root 4.0K Mar 19 00:53 development
-rw-r--r-- 1 tomcat7 gbeschbacher 2.5K Sep 8 2014 README.txt
-rw-r--r-- 1 tomcat7 gbeschbacher 29M Mar 19 00:13 solr.war
-rw-r--r-- 1 tomcat7 gbeschbacher 333 Mar 19 00:52 solr.xml
-rw-r--r-- 1 tomcat7 gbeschbacher 501 Sep 8 2014 zoo.cfg
In here, the solr.xml contains the following code:
/u/s/s/e/solr ❯❯❯ cat solr.xml
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="false">
<cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
<core name="atalanda_development" instanceDir="development" dataDir="development/data"/>
</cores>
</solr>
So, at the moment i really have no clue anymore what i still could try to get my setup to work because i don't know what i am doing wrong in here. Any suggestions or try-out solutions are appreciated even it's only a comment on what i could change.
If someone needs any more information to be able to give some hints, please tell me so and I'll provide it!

Related

PostgreSQL create extension mongo_fdw

I want to connect a PostgreSQL database with a MongoDB by using Mongo_fdw. After following this instruction to install mongo_fdw with the autogen.sh script on Ubuntu 22.04 LTS, I wanted to check the connection and ran CREATE EXTENSION mongo_fdw; in my database, but the following error occured:
ERROR: could not access file "$libdir/mongo_fdw": No such file or directory
Searchig for a solution I found this page on GitHub, where the same error is discussed. Following the recommendations there, I checked pg_config --version, pg_config --libdir and pg_config --sharedir with the following results:
$ pg_config --version
PostgreSQL 12.9
$ pg_config --libdir
/home/qgis/anaconda3/lib
$ pg_config --sharedir
/home/qgis/anaconda3/share
When I check /home/qgis/anaconda3/share/extension I get the following files:
drwxrwxr-x 2 qgis qgis 4096 Feb 1 10:58 ./
drwxrwxr-x 32 qgis qgis 4096 Jan 18 10:28 ../
-rw-r--r-- 1 root root 157 Feb 1 10:58 mongo_fdw--1.0--1.1.sql
-rw-r--r-- 1 root root 593 Feb 1 10:58 mongo_fdw--1.0.sql
-rw-r--r-- 1 root root 709 Feb 1 10:58 mongo_fdw--1.1.sql
-rw-r--r-- 1 root root 274 Feb 1 10:58 mongo_fdw.control
-rw-rw-r-- 2 qgis qgis 310 Jun 24 2022 plpgsql--1.0.sql
-rw-rw-r-- 2 qgis qgis 179 Jun 24 2022 plpgsql.control
-rw-rw-r-- 2 qgis qgis 370 Jun 24 2022 plpgsql--unpackaged--1.0.sql
I also ran ldconfig as it is recommended on the GitHub page but with no results.
Does someone has an idea how to solve this error?
Thanks in advance!
You have to specify the correct pg_config when building the software, probably
make PG_CONFIG=/usr/lib/postgresql/14/bin/pg_config
That file should exist if you installed the package with the C headers, which is typically called "devel" or "dev" or similar.

Linux Images wont show up on main root folder but will on a subfolder

I have playing with some docker containers with LAMP.
The issue I am facing is that if I put my webpage to the www folder the page is showing up but the images from the folder www/icons/test.png wont show up. (http://192.168.123.123:8082/icons/test.png)
I get
Not Found
The requested URL was not found on this server.
Apache/2.4.38 (Debian) Server at 192.168.123.123 Port 8082
I made a copy of the icons folder to a subfolder www/test/icons/test.png and its working fine!
If I change path on the webpage all good.(http://192.168.123.123:8082/test/icons/test.png)
I checked the permissions for both folders and subfiles and they are the same!
drwxr-xr-x 11 userwh2 userwh2 4096 Aug 2 08:53 www
drwxr-xr-x 2 userwh2 userwh2 4096 Aug 1 10:19 www/icons
-rw-r--r-x 1 userwh2 userwh2 12145 Jul 24 2020 www/icons/test.png
drwxr-xr-x 3 userwh2 userwh2 4096 Aug 2 08:52 www/test
drwxr-xr-x 2 userwh2 userwh2 4096 Aug 1 10:19 www/test/icons
-rw-r--r-x 1 userwh2 userwh2 12145 Jul 24 2020 www/test/icons/test.png
I cant figure it out....
Any ideas anyone?
Edit:
Found this in the log:
Cannot serve directory /usr/share/apache2/icons/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
Actually I was able to find an answer
https://forum.getkirby.com/t/subpage-not-working-after-digital-ocean-deployment/16083/41
Seems like the /icons folder name its used by apache2 when doing a lookup and that is why its getting confused. Its like a common name probably in apache (ex, root, etc)

CentOS and fontconfig: Cannot load default config file

I'm getting following error when using imagick:
Fontconfig error: Cannot load default config file
My script is working but i would like to fix this (is filling up log file).
OS is:
# cat /etc/redhat-release
CentOS release 5.10 (Final)
I was looking trough internet little bit and this is causing problem:
access("/etc/fonts/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
Folder exists:
# ls /etc/fonts/ -all
total 64
drwxr-xr-x 4 root root 4096 Jul 9 2010 ./
drwxr-xr-x 86 root root 12288 Jan 13 00:48 ../
drwxr-xr-x 2 root root 4096 Jan 3 2012 conf.avail/
drwxr-xr-x 2 root root 4096 Apr 14 2013 conf.d/
-rw-r--r-- 1 root root 5239 Jan 12 2008 fonts.conf
-rw-r--r-- 1 root root 6907 Jan 12 2008 fonts.dtd
But i see only this folder via root account, other account under with script is run doesn't see this folder. Permissions looks fine for me, but not so experienced with linux.
Account under with script is run is created with WHM.
Please help :)
I manage to solve my problem. chroot was making trouble.
I need to:
log with root account
find jailed environment of account on with i run script (in my case /home/virtfs/[username])
to create folder where i will mount real stuff mkdir /home/virtfs/[username]/etc/fonts
to mount /etc/fonts to this folder: mount --bind /etc/fonts /home/virtfs/[username]/etc/fonts
Posting an answer for CentOS 7 in 2021:
yum install fontconfig
More info here:
https://centos.pkgs.org/7/centos-x86_64/fontconfig-2.13.0-4.3.el7.x86_64.rpm.html

Linux Joomla Can't write to file with 755 permission

Hello I am trying to setup Joomla. When I try to change some settings through the Global Settings Manager, and then save, I keep getting and error saying I can't write to that file.
I have tried playing around with the settings and file permissions even changing them to 755, and it still won't let me write to the file.
I have the owner set to 'root.root' and am running Fedora 18.
I have it installed on localhost, and not through FTP.
Why can't I write to these files (like configuration.php), is there something I am missing?
Joomla does not tell me what file I am trying to write to, but I assume if I'm editing Global Settings it attempts to write to configuration.php.
here is the output of ls -l /var/www/html/joomla
total 116
-rw-r--r--. 1 apache apache 17816 Nov 6 15:18 LICENSE.txt
-rw-r--r--. 1 apache apache 4300 Nov 6 15:18 README.txt
drwxr-xr-x. 10 apache apache 4096 Nov 6 15:18 administrator
drwxr-xr-x. 2 apache apache 4096 Nov 6 15:18 bin
drwxr-xr-x. 2 apache apache 4096 Nov 6 15:18 cache
drwxr-xr-x. 2 apache apache 4096 Nov 6 15:18 cli
drwxr-xr-x. 17 apache apache 4096 Nov 6 15:18 components
-rw-r--r--. 1 apache apache 2018 Dec 6 05:56 configuration.php
-rw-r--r--. 1 apache apache 3118 Nov 6 15:18 htaccess.txt
drwxr-xr-x. 5 apache apache 4096 Nov 6 15:18 images
drwxr-xr-x. 2 apache apache 4096 Nov 6 15:18 includes
-rw-r--r--. 1 apache apache 1011 Nov 6 15:18 index.php
-rw-r--r--. 1 apache apache 1909 Nov 6 15:20 joomla.xml
drwxr-xr-x. 4 apache apache 4096 Nov 6 15:18 language
drwxr-xr-x. 4 apache apache 4096 Nov 6 15:18 layouts
drwxr-xr-x. 12 apache apache 4096 Nov 6 15:18 libraries
drwxr-xr-x. 2 apache apache 4096 Dec 6 04:51 logs
drwxr-xr-x. 18 apache apache 4096 Nov 6 15:18 media
drwxr-xr-x. 28 apache apache 4096 Nov 6 15:18 modules
drwxr-xr-x. 14 apache apache 4096 Nov 6 15:18 plugins
-rw-r--r--. 1 apache apache 901 Nov 6 15:18 robots.txt.dist
drwxr-xr-x. 5 apache apache 4096 Dec 6 04:39 templates
drwsr-xr-x. 2 apache apache 4096 Dec 6 04:44 tmp
-rw-r--r--. 1 apache apache 1715 Nov 6 15:18 web.config.txt
And output of ls -ld joomla/
drwxr-xr-x. 18 apache apache 4096 Dec 6 05:57 joomla/
Also, running the command tail -f /var/log/httpd/error_log I get this
PHP Warning: file_put_contents(/var/www/html/joomla/configuration.php): failed to open stream: Permission denied in /var/www/html/joomla/libraries/joomla/filesystem/file.php on line 422, referer: http://localhost/administrator/index.php?option=com_config
After digging a bit deeper into the problem. I discovered that SELinux was blocking r/w access to httpd. This could be seen when running
ls -aLZ joomla
By running the command you would see that all files would show up to be
httpd_sys_content_t
When they really should be
httpd_sys_rw_content_t
Running a simple
chcon -R -t httpd_sys_content_rw_t /var/www/html/joomla/
AND VOILA! Problem Solved.
Thank you everyone for the help, and I hope someone else can benefit from this in the near future.
Try restarting the webserver?
As the permission must get reflected.

svn permission issue - txn-current-lock: Permission denied

I setup svn on my local system /svn/repos/myproject by following this tutorial. I'm able to view the repo in browser.
But when it try to import new project I couldn't through svn client ( rapid svn ) it shows following error:
Execute: Import
Error while performing action:
Can't open file '/svn/repos/myproject/db/txn-current-lock': Permission denied
Svn directory permissions:
→ ls -l /svn
total 12
drwxrwxr-x 2 root root 4096 Feb 15 12:09 permissions
drwxrwxr-x 4 apache apache 4096 Feb 15 12:09 repos
drwxrwxr-x 2 root root 4096 Feb 15 12:09 users
Repo directory:
→ ls -l
total 8
drwxrwxr-x 3 root root 4096 Feb 15 12:09 conf
drwxrwxr-x 7 apache apache 4096 Feb 15 12:09 myproject
How to solve this issue?
I've given 777 permission to repos directory which solved this issue. But i got another issue like Couldn't perform atomic initialization.
I think this is due to incompatible sqlite version with subversion we're using, this can be solved by updating svnadmin command,
svnadmin create --pre-1.6-compatible --fs-type fsfs /svn/repos/myproject

Resources