Server
Manually start Solr server in docker (wodby)
If you have problem issue with your Solr server like it was not connected to your site, you might need to manually start your Solr server. First, you need to login to your Solr docker container: make shell solr Check the status first. Inside the Solr container, run: solr status If you see something like this: neither jattach nor jstack in /opt/java/openjdk could be found, so no thread dumps are possible. Continuing. No Solr nodes are running. It means your Solr is not running. You can then proceed to start the Solr server by running: solr start If you see this message: neither jattach nor jstack in /opt/java/openjdk could be found, so no thread dumps are possible. Continuing. Waiting up to 180 seconds to see Solr running on port 8983 [\] Started Solr server on port 8983 (pid=131). Happy searching! It means your Solr server is up and running. Next step is to create a Solr core (Optional if your Solr core is not yet created). The command below will create a core with specific configuration. solr create_core -c [core-name] -d /opt/solr/server/solr/configsets/search_api_solr_4.2.0/conf/ And that's it!Apache service randomly stopping
If you're apache server somehow stops working randomly, first thing you can do is to check Apache error logs. [Mon May 24 15:39:26.328479 2021] [php7:error] [pid 3203] [client 52.65.15.196:9267] script '/var/www/html/wp-login.php' not found or unable to stat [Mon May 24 15:39:26.852814 2021] [php7:error] [pid 7809] [client 52.65.15.196:31930] script '/var/www/html/wp-login.php' not found or unable to stat [Mon May 24 15:42:15.348017 2021] [php7:error] [pid 6091] [client 52.192.73.251:59992] script '/var/www/html/wp-login.php' not found or unable to stat [Mon May 24 15:42:18.382698 2021] [php7:error] [pid 6263] [client 52.192.73.251:20394] script '/var/www/html/wp-login.php' not found or unable to stat [Mon May 24 15:51:41.982574 2021] [php7:error] [pid 4420] [client 3.8.12.221:32028] script '/var/www/html/wp-login.php' not found or unable to stat [Mon May 24 15:51:42.243716 2021] [php7:error] [pid 15790] [client 3.8.12.221:39625] script '/var/www/html/wp-login.php' not found or unable to stat For my case, the logs above are so suspicious because I don't even run a Wordpress site. So it feels like something or someone is trying to brute force attack my server. If you have notice something similar, one thing you can do is to install Fail2ban. Installing in Ubuntu 16.04 apt-get install fail2ban then copy jail.conf to jail.local cd /etc/fail2ban cp jail.conf jail.local edit jail.local and search for "apache-noscript" [apache-noscript] enabled=true then restart the fail2ban service to reload the configurations service fail2ban restart to check the status like the ip addresses that were banned and some statistics, run fail2ban-client status apache-noscript0Read moreJenkins (standalone) SSL + Let's Encrypt
In this tutorial, I will show how to use Let's Encrypt free SSL with a standalone Jenkins in Ubuntu 16.04. Installation of certbot and jenkins are not included in this tutorial. Generate Certificates Run the command to generate the certificate and key files. sudo certbot certonly --standalone --preferred-challenges http -d example.com You should get this response: Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator standalone, Installer None Obtaining a new certificate Performing the following challenges: http-01 challenge for example.com Waiting for verification... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/example.com/privkey.pem Your cert will expire on 2019-02-07. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le Just in case you got this response: Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator standalone, Installer None Obtaining a new certificate Performing the following challenges: http-01 challenge for example.com Cleaning up challenges Problem binding to port 80: Could not bind to IPv4 or IPv6. You need to stop your web server and try again. Convert the certificate to JKS keystore Go to your certificate folder cd /etc/letsencrypt/live/example.com And execute this command to convert the certificate to PKCS12 file first openssl pkcs12 -inkey privkey.pem -in fullchain.pem -export -out keys.pkcs12 If you are renewing the certificates, make sure to delete the existing /var/lib/jenkins/jenkins.jks file first. Then convert to JKS file keytool -importkeystore -srckeystore keys.pkcs12 -srcstoretype pkcs12 -destkeystore /var/lib/jenkins/jenkins.jks Enter export and import passwords and answer "yes" if asked to overwrite an existing alias Enter Export Password: Verifying - Enter Export Password: root@example:/etc/letsencrypt/live/example.com# keytool -importkeystore -srckeystore keys.pkcs12 -srcstoretype pkcs12 -destkeystore /var/lib/jenkins/jenkins.jks Importing keystore keys.pkcs12 to /var/lib/jenkins/jenkins.jks... Enter destination keystore password: Enter source keystore password: Existing entry alias 1 exists, overwrite? [no]: yes Entry for alias 1 successfully imported. Import command completed: 1 entries successfully imported, 0 entries failed or cancelled Set Jenkins configuration to use the SSL Edit the Jenkins config file vim /etc/default/jenkins Look for JENKINS_ARGS and update the value to this: JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=-1 --httpsPort=8443 --httpsKeyStore=/var/lib/jenkins/jenkins.jks --httpsKeyStorePassword=PASSWORD_SET_ON_CONVERT_TO_JKS" Restart jenkins sudo service jenkins restartMAMP MySQL not starting
Occasionally, your MAMP MySQL server will just stop working and will not start again even you quit and open MAMP again. Here are the 2 solutions that always worked for me. /Applications/MAMP/logs/mysql_error_log.err InnoDB: Unable to lock ./ibdata1, error: 35 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. Solution #1 Steps: Quit MAMP Kill all mysqld process killall -9 mysqld Open MAMP If the Solution #1 didn't work, try this Solution #2 Steps: Quit MAMP Get all mysqld Process IDs (PIDs) ps -ef | grep mysql Sample Result: 501 28623 1 0 1:09PM ?? 0:00.09 /bin/sh /Applications/MAMP/Library/bin/mysqld_safe --port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --log-error=/Applications/MAMP/logs/mysql_error_log 501 29183 28623 0 1:09PM ?? 0:01.80 /Applications/MAMP/Library/bin/mysqld --basedir=/Applications/MAMP/Library --datadir=/Applications/MAMP/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=8889 The PID the 2nd column (28623, 29183) Kill all process by PID kill 28623 kill 29183 Open MAMPSetting up Jenkins item + Bitbucket
In this article, I will share with you how I setup my Jenkins to get updates from Bitbucket. Jenkins Make sure you already installed Jenkins "Bitbucket Plugin" General This is where you put all the basic setting for your Jenkins item like Name, Description Source Code Management This is the part where you put your Bitbucket repository details. Put your repository URL in Repository URL input box. Credentials - The credentials for the repository URL. This should be your Bitbucket account credentials. Click the "Add" button beside the select box to create a new credential. Branch Specifier - The git branch you want to deploy. Usually you want to use "refs/heads/master" for the master branch. Build Triggers Tick "Build when a change is pushed to BitBucket" Build Click "Add build step" and select "Execute shell" and put all the shell commands you want to execute during build like running composer update and drush commands. Execute the build Server Login to SSH Create a symbolic link of your workspace We need to create the symbolic link of your project workspace to the actual project that was setup in your web server like Apache. ln -sv /var/lib/jenkins/workspace/[your-cool-project] /var/www/html/[your-cool-project] Follow these steps to install Jenkins on Ubuntu 16.040Read more