Help building Mediawiki into jail

Status
Not open for further replies.

carrabta

Dabbler
Joined
Jan 12, 2018
Messages
10
Dear all,
I would need someone's help to build a working Mediawiki. Here below is where I got up to.
Created the jail
Downloaded Apache24 via 'pkg install'
Dowloaded PHP via 'pkg install'
Downloaded Mediawiki via 'pkg install'

I got the Apache running (as I managed to display the html file), but impossible to configure Mediawiki as it is impossible to open any PHP file.
Here is the display I get when I try :
"startSession() ) { if ( $installer->request->getVal( "css" ) ) { // Do not display errors on css pages $installer->outputCss(); exit; } $errors = $installer->getPhpErrors(); $installer->showError( 'config-session-error', $errors[0] ); $installer->finish(); exit; } $fingerprint = $installer->getFingerprint(); if ( isset( $_SESSION['installData'][$fingerprint] ) ) { $session = $_SESSION['installData'][$fingerprint]; } else { $session = array(); } if ( !is_null( $wgRequest->getVal( 'uselang' ) ) ) { $langCode = $wgRequest->getVal( 'uselang' ); } elseif ( isset( $session['settings']['_UserLang'] ) ) { $langCode = $session['settings']['_UserLang']; } else { $langCode = 'en'; } $wgLang = Language::factory( $langCode ); RequestContext::getMain()->setLanguage( $wgLang ); $installer->setParserLanguage( $wgLang ); $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT]; $session = $installer->execute( $session ); $_SESSION['installData'][$fingerprint] = $session; }"

So I got back in the PHP folder and made a few 'make install clean" in the 'ports' folder, but still no luck....

I'd appreciate some help as I don't know where else to look. Should I have to restart something, like a service ? Or configure something else ?
Thank you !
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633

carrabta

Dabbler
Joined
Jan 12, 2018
Messages
10
Thanks for that reply. I did forgot to mention I had installed MariaDB as suggested on Mediwiki website.
I wouldn't think this would be the problem as I can't open any PHP file. I guess it is with my PHP conf that something is wrong....
I'll read the link to see if I find out anything - thanks
 

carrabta

Dabbler
Joined
Jan 12, 2018
Messages
10
Ok - got PHP up and running !
Issue was probably when I installed Mediawiki package. It seems to have messed up the install. So I removed PHP (which removed Mediawiki) and re-installed PHP, and followed the steps in the 2nd link in Nick2253 reply and job done ! The test file displays perfect.

Next step is to install the database which is another struggle....
I tried with MariaDB but could not find a 'my.cnf' file anywhere, I tried to by-pass using it and got stuck when running the 'secure-configuration' script as it could not connect to the DB. With nowhere else to look, I removed MariaDB and installed MySQL. I got a 'my.cnf' file, but whichever IP I have in there (127.0.0.1 or my local IP for the jail), it cannot connect to the DB. And I can see with 'service -e' that 'mysql-server' is running. I tried restarting Apache, but no change,..... not sure where else to look.
Any help's welcome !
Tang'
 

carrabta

Dabbler
Joined
Jan 12, 2018
Messages
10
.... correction : MySQL is NOT running, but can't figure out why :
Code:
root@Wikitang:/usr/local # service mysql-server restart																			 
mysql not running? (check /var/db/mysql/Wikitang.pid).																			 
Starting mysql.																													 
root@Wikitang:/usr/local # service mysql-server status																			 
mysql is not running.

... any idea ???
 

carrabta

Dabbler
Joined
Jan 12, 2018
Messages
10
I'm out of ideas, here !....
I retried with MariaDB, so 'pkg remove mysql-server' (and client) and installed 'pkg install mariadb-server' (and client).
Basically, I followed the steps form the blog :
http://www.wordpress.lonbil.co.uk/2014/01/installing-mysql-freenas-jail/
... but still impossible to start the service ! Running the command
Code:
service mysql-server start

gives me no fault, but running
Code:
service mysql-server status

tells me mysql is not running.
If I try to run
Code:
mysql_secure_installation
, I get, right after the passwd question :
Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

... and in effect, /tmp/mysql.sock does not exist there nor anywhere else in my system....

Quite strangely, looking at the mysql-server script, it begins with :
Code:
# Add the following line to /etc/rc.conf to enable mysql:																		   
# mysql_(instance_)?enable (bool):	  Set to "NO" by default.																	 
#					   Set it to "YES" to enable MySQL.																			
# mysql_(instance_)?limits (bool):	  Set to "NO" by default.																	 
#					   Set it to yes to run `limits -e -U mysql`																   
#					   just before mysql starts.																				   
# mysql_(instance_)?dbdir (str):		Default to "/var/db/mysql"																 
#					   Base database directory.																					
# mysql_(instance_)?args (str): Custom additional arguments to be passed															
#					   to mysqld_safe (default empty).																			 
# mysql_(instance_)?pidfile (str): Custum PID file path and name.																   
#					   Default to "${mysql_dbdir}/${hostname}.pid".																
# mysql_(instance_)?user (str): User to run mysqld as																			   
#					   Default to "mysql" created by the port																	 
# mysql_(instance_)?optfile (str): Server-specific option file.																	 
#					   Default to "${mysql_dbdir}/my.cnf".																		 
# mysql_instances (str): Set to "" by default.																					 
#					   If defined, list of instances to enable

Is this something I need to do, really, or is it what the script actually does ?

I'd really need a hint, to move forward. Anyone ?
Cheers !
Tang'
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
It sounds like you didn't follow the instructions to enable the mysql service:

To enable MySQL server as a service, add mysql_enable="YES" to the /etc/rc.conf file.
 

carrabta

Dabbler
Joined
Jan 12, 2018
Messages
10
But I did. See the result in /etc/rc.conf :

root@Wikitang:/ # less /etc/rc.conf
portmap_enable="NO"
sshd_enable="NO"
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
hostname="Wikitang"
devfs_enable="YES"
devfs_system_ruleset="devfsrules_common"
inet6_enable="YES"
ip6addrctl_enable="YES"
apache24_enable="YES"
mysql_enable="yes"
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Can you try rebooting everything, and running service mysql-server start and service mysql-server status again?
 

carrabta

Dabbler
Joined
Jan 12, 2018
Messages
10
Same result after reboot.... :

root@Wikitang:/ # service mysql-server start
Starting mysql.
root@Wikitang:/ # service mysql-server status
mysql is not running.


Note : when I run the start service, it takes quite a time (let's say 20s) before giving me back the prompt.
Note 2 : I see no trace of this starting trial in the /var/db/mysql/Wikitang.pid but can find a past trial to start up the process, if that helps ? Here it is

2018-01-14T17:42:46.682125Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.20-log) starting as process 95334 ...
/usr/local/libexec/mysqld: Undefined symbol "fdatasync"
2018-01-14T17:42:46.6NZ mysqld_safe mysqld from pid file /var/db/mysql/Wikitang.pid ended
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
/usr/local/libexec/mysqld: Undefined symbol "fdatasync"
That's been coming up a bit lately--some searching on 'fdatasync' should find a solution for you.
 
Status
Not open for further replies.
Top