0

Tips & Tricks : Installing PHP Xdebug on openSUSE with pecl

-

If you need to install Xdebug on openSUSE and don’t want ot use existing binary repo easiest way is to use pecl to do that and here is how…

First install all required packages

dev-lnx-02:~ # zypper --non-interactive install gcc autoconf automake php5 php5-pear php5-devel

Now we can download and install Xdebug itself:

(more…)

0

Tips & Tricks : Yii framework update issue

-

When Yii-based project doesn’t want to update, there might be missing component.

Once you add one plugin everything goes back to normal.

[root@arb-srv-01 easyforms]# composer update
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found.
- Installation request for yiisoft/yii2 2.0.7 -> satisfiable by yiisoft/yii2[2.0.7].

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
[root@arb-srv-01 easyforms]# composer global require "fxp/composer-asset-plugin"

Changed current directory to /root/.config/composer
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Using version ^1.2 for fxp/composer-asset-plugin
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing fxp/composer-asset-plugin (v1.2.1)
Downloading: 100%

Writing lock file
Generating autoload files
[root@arb-srv-01 easyforms]#

Hope that helps.

0

How-to : Introduction to Laravel : Publish Laravel Framework project on Apache 2.4

-

In previous article “How-to : Introduction to Laravel : Create a Laravel Framework project on openSUSE Leap 42.1” we’ve created Laravel project called demo-project.

However, this project is not available on web server, so we can’t open it in web browser and see it’s content.

Let’s configure Apache server to serve our demo-project.

In this article we will:

  • Place project files in appropriate folder
  • Adjust files ownership for proper publishing
  • Create configuration for Apache, so our content will be available

Let’s get to work…

(more…)

4

How-to : Publish multiple URLs with single IP and HAProxy

-

Many times there is a need to publish multiple websites from internal network, but there is only one public IP address available.

How this can be done easy way? HAProxy can help us with it.

In example configuration I have 2 URLs registered to same public IP address:

  • first.laboratory.net
  • second.laboratory.net
  • third.laboratory.net

Here is how HAProxy configuration for given example looks like…

(more…)

0

Code snippets : Restart IIS Application Pool in PowerShell

-

If you need to watch IIS application pool and start it once goes down and want to use PowerShell for that here is simple script for that.

Script includes also logging all restarts in log file which is created in same folder as script.

# AppPool to monitor
$AppPoolName = "AppPoolName"

# Log Destination
$LogToScreen = 1
$LogToFile = 1

# Determine script location for PowerShell
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path

# Output log
$OutputLogPath = $ScriptDir + "\AppPoolRestart.csv"

#Check if file exists and create if it doesn't
If(!(Test-Path -Path $OutputLogPath)){
#Create file and start logging
New-Item -Path $OutputLogPath -ItemType File
}

###
# Function: LogMessage
###
function LogMessage($Msg, $ToScreen, $ToFile)
{
if ($ToScreen -eq 1)
{
Write-Host $Message
}

If ($ToFile -eq 1)
{
Add-Content -Path $OutputLogPath -Value $Message
}
}
###
# End Function: LogMessage
###

While (1 -eq 1){

Clear-Host

$AppPoolStatus = Get-WebAppPoolState -Name $AppPoolName

$DateTime = Get-Date

If ($AppPoolStatus.Value -eq "Stopped"){
Write-Host "Not Working"
Start-WebAppPool -Name $AppPoolName
$Message = "App Pool $AppPoolName restarted at $DateTime"
LogMessage $Message $LogToScreen $LogToFile
}Else{
Write-Host "Working"
}

Sleep 5
}
0

Tips & Tricks : Apache2 autostart on openSUSE 13.1

-

In order to have Apache2 started automatically after reboot use:


systemctl enable apache2.service